Class: Pageflow::Admin::AdminOnlyTabPolicy Private
- Inherits:
-
Object
- Object
- Pageflow::Admin::AdminOnlyTabPolicy
- Defined in:
- app/policies/pageflow/admin/admin_only_tab_policy.rb
Overview
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 Attribute Summary collapse
- #tab ⇒ Object readonly private
- #user ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(user, tab) ⇒ AdminOnlyTabPolicy
constructor
private
A new instance of AdminOnlyTabPolicy.
- #see? ⇒ Boolean private
Constructor Details
#initialize(user, tab) ⇒ AdminOnlyTabPolicy
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 AdminOnlyTabPolicy.
7 8 9 10 |
# File 'app/policies/pageflow/admin/admin_only_tab_policy.rb', line 7 def initialize(user, tab) @user = user @tab = tab end |
Instance Attribute Details
#tab ⇒ Object (readonly)
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.
5 6 7 |
# File 'app/policies/pageflow/admin/admin_only_tab_policy.rb', line 5 def tab @tab end |
#user ⇒ Object (readonly)
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.
5 6 7 |
# File 'app/policies/pageflow/admin/admin_only_tab_policy.rb', line 5 def user @user end |
Instance Method Details
#see? ⇒ 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.
12 13 14 |
# File 'app/policies/pageflow/admin/admin_only_tab_policy.rb', line 12 def see? !tab.admin_only? || user.admin? end |