Class: Pageflow::FilePolicy Private
- Inherits:
-
ApplicationPolicy
- Object
- ApplicationPolicy
- Pageflow::FilePolicy
- Defined in:
- app/policies/pageflow/file_policy.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
-
#initialize(user, file) ⇒ FilePolicy
constructor
private
A new instance of FilePolicy.
- #manage? ⇒ Boolean private
- #use? ⇒ Boolean private
Constructor Details
#initialize(user, file) ⇒ FilePolicy
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of FilePolicy.
4 5 6 7 |
# File 'app/policies/pageflow/file_policy.rb', line 4 def initialize(user, file) @user = user @file = file end |
Instance Method Details
#manage? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
9 10 11 |
# File 'app/policies/pageflow/file_policy.rb', line 9 def manage? can_edit_any_entry_using_file?(@file.parent_file || @file) end |
#use? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
13 14 15 |
# File 'app/policies/pageflow/file_policy.rb', line 13 def use? can_preview_any_entry_using_file? end |