Sha256: 787c1cd655cf39a99df8e615d00d682801777927e34c62821d30b5976537623e

Contents?: true

Size: 420 Bytes

Versions: 32

Compression:

Stored size: 420 Bytes

Contents

class Group < ActiveRecord::Base
  has_and_belongs_to_many :roles
  has_many :groups_users
  has_many :users, :through => :groups_users, :conditions => {'groups_users.granted' => true}

  attr_protected []

  def admins
    users = []
    perms = Permission.where(:resource_type => 'Group', :resource => name, :action => 'edit').includes(:role => :users)
    perms.each { |p| users += p.role.users }
    users
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
gb_mapfish_appserver-0.8.4 app/models/group.rb
gb_mapfish_appserver-0.8.3 app/models/group.rb
gb_mapfish_appserver-0.8.2 app/models/group.rb
gb_mapfish_appserver-0.8.1 app/models/group.rb
gb_mapfish_appserver-0.8.0 app/models/group.rb
gb_mapfish_appserver-0.0.7 app/models/group.rb
gb_mapfish_appserver-0.0.6 app/models/group.rb
gb_mapfish_appserver-0.0.5 app/models/group.rb
gb_mapfish_appserver-0.0.4 app/models/group.rb
gb_mapfish_appserver-0.0.3 app/models/group.rb
gb_mapfish_appserver-0.0.2 app/models/group.rb
gb_mapfish_appserver-0.0.1 app/models/group.rb