Class: Pageflow::FolderPolicy Private
- Inherits:
-
ApplicationPolicy
- Object
- ApplicationPolicy
- Pageflow::FolderPolicy
- Defined in:
- app/policies/pageflow/folder_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.
Defined Under Namespace
Classes: Scope
Instance Method Summary collapse
-
#initialize(user, folder) ⇒ FolderPolicy
constructor
private
A new instance of FolderPolicy.
- #manage? ⇒ Boolean private
- #show_account_selection_on? ⇒ Boolean private
Constructor Details
#initialize(user, folder) ⇒ FolderPolicy
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 FolderPolicy.
44 45 46 47 |
# File 'app/policies/pageflow/folder_policy.rb', line 44 def initialize(user, folder) @user = user @folder = folder 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.
49 50 51 |
# File 'app/policies/pageflow/folder_policy.rb', line 49 def manage? allows?(%w[publisher manager]) end |
#show_account_selection_on? ⇒ 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.
53 54 55 56 |
# File 'app/policies/pageflow/folder_policy.rb', line 53 def show_account_selection_on? (@user.admin? && Account.all.size > 1) || @user.memberships.as_publisher_or_above.on_accounts.size > 1 end |