Class: ForemanTasks::Dynflow::ConsoleAuthorizer
- Inherits:
-
Object
- Object
- ForemanTasks::Dynflow::ConsoleAuthorizer
- Defined in:
- lib/foreman_tasks/dynflow/console_authorizer.rb
Instance Method Summary collapse
- #allow? ⇒ Boolean
-
#initialize(env) ⇒ ConsoleAuthorizer
constructor
A new instance of ConsoleAuthorizer.
Constructor Details
#initialize(env) ⇒ ConsoleAuthorizer
Returns a new instance of ConsoleAuthorizer.
4 5 6 7 8 9 |
# File 'lib/foreman_tasks/dynflow/console_authorizer.rb', line 4 def initialize(env) @rack_request = Rack::Request.new(env) @user_id = @rack_request.session[:user] @expires_at = @rack_request.session[:expires_at] @user = User.where(:id => @user_id).first unless session_expired? end |
Instance Method Details
#allow? ⇒ Boolean
11 12 13 |
# File 'lib/foreman_tasks/dynflow/console_authorizer.rb', line 11 def allow? @user && (unlimited_edit? || ) end |