Class: Relation::Public
- Defined in:
- app/models/relation/public.rb
Class Method Summary collapse
- .default_for(actor) ⇒ Object
-
.of(actor) ⇒ Object
The Public belonging to actor.
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.
-
#name ⇒ Object
The name of public relation.
Methods inherited from Relation
allow, allow?, #mode, normalize, normalize_id
Class Method Details
.default_for(actor) ⇒ Object
9 10 11 |
# File 'app/models/relation/public.rb', line 9 def default_for(actor) create! :actor => actor end |
.of(actor) ⇒ Object
The Relation::Public belonging to actor
14 15 16 |
# File 'app/models/relation/public.rb', line 14 def of(actor) actor(actor).first end |
Instance Method Details
#<=>(relation) ⇒ Object
A public relation is always the weakest
20 21 22 |
# File 'app/models/relation/public.rb', line 20 def <=>(relation) 1 end |
#allow?(user, action, object) ⇒ Boolean
Are we supporting custom permissions for Relation::Public? Not by the moment.
30 31 32 |
# File 'app/models/relation/public.rb', line 30 def allow?(user, action, object) action == 'read' && object == 'activity' end |
#name ⇒ Object
The name of public relation
25 26 27 |
# File 'app/models/relation/public.rb', line 25 def name I18n.t('relation_public.name') end |