fix group autocomplete

This commit is contained in:
Alexander Machehin 2012-02-02 02:42:23 +06:00
parent 8562b882da
commit cb7a9fcc21
2 changed files with 1 additions and 2 deletions

View File

@ -31,7 +31,7 @@ class Ability
can [:show, :update], Settings::Notifier, :user_id => user.id
can [:read, :create], Group
can [:read, :create, :autocomplete_group_uname], Group
can [:update, :manage_members], Group do |group|
group.objects.exists?(:object_type => 'User', :object_id => user.id, :role => 'admin') # or group.owner_id = user.id
end

View File

@ -22,7 +22,6 @@ class Group < ActiveRecord::Base
delegate :ssh_key, :to => :owner
after_create :add_owner_to_members
after_initialize lambda {|r| r.name ||= r.uname } # default
include Modules::Models::PersonalRepository
# include Modules::Models::Owner