Class: Relation::Public
- Defined in:
- app/models/relation/public.rb
Constant Summary collapse
- PERMISSIONS =
[ [ 'read', 'activity' ] ]
Constants inherited from Relation
Instance Method Summary collapse
-
#<=>(relation) ⇒ Object
A public relation is always the weakest.
-
#allow?(user, action, object) ⇒ Boolean
Are we supporting custom permissions for Public? Not by the moment.
Methods inherited from Single
#available_permissions, instance, #name, permissions
Methods inherited from Relation
allow, allow?, #available_permissions, create_activity?, #follow?, ids_shared_with, #mode, negative_names, normalize, normalize_id, #positive?, positive_names, system_list
Instance Method Details
#<=>(relation) ⇒ Object
A public relation is always the weakest
8 9 10 |
# File 'app/models/relation/public.rb', line 8 def <=>(relation) 1 end |
#allow?(user, action, object) ⇒ Boolean
Are we supporting custom permissions for Relation::Public? Not by the moment.
13 14 15 |
# File 'app/models/relation/public.rb', line 13 def allow?(user, action, object) action == 'read' && object == 'activity' end |