Class: Ahoy::VisitPolicy
- Inherits:
-
Object
- Object
- Ahoy::VisitPolicy
- Defined in:
- app/policies/ahoy/visit_policy.rb
Overview
Pundit policy for web stats (powered by Ahoy)
Instance Attribute Summary collapse
-
#record ⇒ Object
readonly
Returns the value of attribute record.
-
#this_user ⇒ Object
readonly
Returns the value of attribute this_user.
Instance Method Summary collapse
- #index? ⇒ Boolean
-
#initialize(this_user, record) ⇒ VisitPolicy
constructor
A new instance of VisitPolicy.
- #search? ⇒ Boolean
Constructor Details
#initialize(this_user, record) ⇒ VisitPolicy
Returns a new instance of VisitPolicy.
13 14 15 16 |
# File 'app/policies/ahoy/visit_policy.rb', line 13 def initialize( this_user, record ) @this_user = this_user @record = record end |
Instance Attribute Details
#record ⇒ Object (readonly)
Returns the value of attribute record.
11 12 13 |
# File 'app/policies/ahoy/visit_policy.rb', line 11 def record @record end |
#this_user ⇒ Object (readonly)
Returns the value of attribute this_user.
11 12 13 |
# File 'app/policies/ahoy/visit_policy.rb', line 11 def this_user @this_user end |
Instance Method Details
#index? ⇒ Boolean
18 19 20 |
# File 'app/policies/ahoy/visit_policy.rb', line 18 def index? @this_user.can? :view_web, :stats end |
#search? ⇒ Boolean
22 23 24 |
# File 'app/policies/ahoy/visit_policy.rb', line 22 def search? index? end |