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-1.1.1 app/models/group.rb
gb_mapfish_appserver-1.1.0 app/models/group.rb
gb_mapfish_appserver-1.0.6 app/models/group.rb
gb_mapfish_appserver-1.0.5 app/models/group.rb
gb_mapfish_appserver-1.0.4 app/models/group.rb
gb_mapfish_appserver-1.0.3 app/models/group.rb
gb_mapfish_appserver-1.0.2 app/models/group.rb
gb_mapfish_appserver-1.0.1 app/models/group.rb
gb_mapfish_appserver-1.0.0 app/models/group.rb
gb_mapfish_appserver-0.9.7 app/models/group.rb
gb_mapfish_appserver-0.9.6 app/models/group.rb
gb_mapfish_appserver-0.9.5 app/models/group.rb
gb_mapfish_appserver-0.9.4 app/models/group.rb
gb_mapfish_appserver-0.9.3 app/models/group.rb
gb_mapfish_appserver-0.9.2 app/models/group.rb
gb_mapfish_appserver-0.9.1 app/models/group.rb
gb_mapfish_appserver-0.9.0 app/models/group.rb
gb_mapfish_appserver-0.8.7 app/models/group.rb
gb_mapfish_appserver-0.8.6 app/models/group.rb
gb_mapfish_appserver-0.8.5 app/models/group.rb