Sha256: 9ba10e91a1ecf61dfa89fe2eb6636fe9b3f4f3c6e3842437053d2e78956d02d5
Contents?: true
Size: 692 Bytes
Versions: 22
Compression:
Stored size: 692 Bytes
Contents
class Relation::Public < Relation scope :actor, lambda { |a| where(:actor_id => Actor.normalize_id(a)) } validates_presence_of :actor_id class << self def default_for(actor) create! :actor => actor end # The {Relation::Public} belonging to actor def of(actor) actor(actor).first end end # A {Relation::Public public relation} is always the weakest def <=>(relation) 1 end # The name of public relation def name I18n.t('relation_public.name') end # Are we supporting custom permissions for {Relation::Public}? Not by the moment. def allow?(user, action, object) action == 'read' && object == 'activity' end end
Version data entries
22 entries across 22 versions & 1 rubygems