Class: Relation::Public

Inherits:
Single show all
Defined in:
app/models/relation/public.rb

Constant Summary

Constants inherited from Relation

Negative, Positive

Instance Method Summary collapse

Methods inherited from Single

default_for, #name, of

Methods inherited from Relation

allow, allow?, #mode, negative_names, normalize, normalize_id, #positive?, positive_names

Instance Method Details

#<=>(relation) ⇒ Object

A public relation is always the weakest



3
4
5
# File 'app/models/relation/public.rb', line 3

def <=>(relation)
  1
end

#allow?(user, action, object) ⇒ Boolean

Are we supporting custom permissions for Relation::Public? Not by the moment.

Returns:

  • (Boolean)


8
9
10
# File 'app/models/relation/public.rb', line 8

def allow?(user, action, object)
  action == 'read' && object == 'activity'
end