Sha256: cfce02ec6ddd66c2b0e695ea46c5d5ec9beaf87ba0d140dbe52ac7c5063fb876
Contents?: true
Size: 721 Bytes
Versions: 29
Compression:
Stored size: 721 Bytes
Contents
class Cms::SetupController < ApplicationController # filters and other customizations can be made here before the cms controllers are run # Returns the current user for the application. # Remove this method if your application already defines a current_user method # or provide valid code that returns a user object for the current user. def current_user @company.users.first end # Define your own authorization logic given one of the cms roles... :all, :cms_admin, :cms_user def authorize_role(role) authorized = case role when :all, :cms_admin, :cms_user current_user.present? else false end redirect_to '/login' unless authorized return authorized end end
Version data entries
29 entries across 29 versions & 1 rubygems