Sha256: 0c6747a64bebcea3e1b3035f7376846867d7d754e052112b5ea3f18dda9c3265
Contents?: true
Size: 616 Bytes
Versions: 72
Compression:
Stored size: 616 Bytes
Contents
module PermissionsHelper DEFAULT_PERMISSIONS = [ [ "read", "activity" ], [ "create", "activity" ], [ "follow", nil ], [ "represent", nil ], [ "notify", nil ] ] def default_permissions @default_permissions ||= DEFAULT_PERMISSIONS.map{ |p| Permission.find_or_create_by_action_and_object *p } end def disable_permission_edit? perm (perm.action == 'represent') and (@relation.ties.size > 0) and perm.relations.include?(@relation) and (perm.relations.where(:actor_id => @relation.actor_id).find_all{|r| r.ties.size > 0}.size <= 1) end end
Version data entries
72 entries across 72 versions & 2 rubygems