Class: Pageflow::Admin::AdminOnlyTabPolicy Private

Inherits:
Object
  • Object
show all
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.

Since:

  • 12.2

Instance Attribute Summary collapse

Instance Method Summary collapse

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.

Since:

  • 12.2



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

#tabObject (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.

Since:

  • 12.2



5
6
7
# File 'app/policies/pageflow/admin/admin_only_tab_policy.rb', line 5

def tab
  @tab
end

#userObject (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.

Since:

  • 12.2



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.

Returns:

  • (Boolean)

Since:

  • 12.2



12
13
14
# File 'app/policies/pageflow/admin/admin_only_tab_policy.rb', line 12

def see?
  !tab.admin_only? || user.admin?
end