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

Version Path
social_stream-1.1.12 base/app/helpers/permissions_helper.rb
social_stream-base-1.1.11 app/helpers/permissions_helper.rb
social_stream-2.0.4 base/app/helpers/permissions_helper.rb
social_stream-base-2.0.4 app/helpers/permissions_helper.rb
social_stream-2.0.3 base/app/helpers/permissions_helper.rb
social_stream-base-2.0.3 app/helpers/permissions_helper.rb
social_stream-1.1.11 base/app/helpers/permissions_helper.rb
social_stream-base-1.1.10 app/helpers/permissions_helper.rb
social_stream-1.1.10 base/app/helpers/permissions_helper.rb
social_stream-base-1.1.9 app/helpers/permissions_helper.rb
social_stream-1.1.9 base/app/helpers/permissions_helper.rb
social_stream-base-1.1.8 app/helpers/permissions_helper.rb
social_stream-1.1.8 base/app/helpers/permissions_helper.rb
social_stream-base-1.1.7 app/helpers/permissions_helper.rb
social_stream-2.0.2 base/app/helpers/permissions_helper.rb
social_stream-base-2.0.2 app/helpers/permissions_helper.rb
social_stream-2.0.1 base/app/helpers/permissions_helper.rb
social_stream-base-2.0.1 app/helpers/permissions_helper.rb
social_stream-2.0.0 base/app/helpers/permissions_helper.rb
social_stream-base-2.0.0 app/helpers/permissions_helper.rb