Class: ForestLiana::PermissionsChecker
- Inherits:
-
Object
- Object
- ForestLiana::PermissionsChecker
- Defined in:
- app/services/forest_liana/permissions_checker.rb
Constant Summary collapse
- @@permissions_per_rendering =
Hash.new
- @@expiration_in_seconds =
(ENV['FOREST_PERMISSIONS_EXPIRATION_IN_SECONDS'] || 3600).to_i
Instance Method Summary collapse
-
#initialize(resource, permission_name, rendering_id) ⇒ PermissionsChecker
constructor
A new instance of PermissionsChecker.
- #is_authorized? ⇒ Boolean
Constructor Details
#initialize(resource, permission_name, rendering_id) ⇒ PermissionsChecker
Returns a new instance of PermissionsChecker.
6 7 8 9 10 |
# File 'app/services/forest_liana/permissions_checker.rb', line 6 def initialize(resource, , rendering_id) @collection_name = ForestLiana.name_for(resource) @permission_name = @rendering_id = rendering_id end |
Instance Method Details
#is_authorized? ⇒ Boolean
12 13 14 |
# File 'app/services/forest_liana/permissions_checker.rb', line 12 def ( || !is_allowed?) ? : true end |