diff options
author | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2013-03-07 11:37:03 +0100 |
---|---|---|
committer | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2013-03-07 11:37:03 +0100 |
commit | 11f186a118285fbc87a536af26730780a9ad01f5 (patch) | |
tree | fe6363b036f60f238916d070b3d0cb0625dd53c8 /app/models/ability.rb | |
parent | 2b94b16ee1201d15b3b9d66e142df311141a47db (diff) | |
parent | 3e19646f46c772e10ed3d7a45e8c974ab23f625b (diff) |
Merge branch 'develop'5.1.1
Diffstat (limited to 'app/models/ability.rb')
-rw-r--r-- | app/models/ability.rb | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/app/models/ability.rb b/app/models/ability.rb index 48cce84..3cd1d4d 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -134,9 +134,6 @@ class Ability can :read, SipAccount, :sip_accountable_type => 'User', :sip_accountable_id => user.id user.sip_accounts.each do |sip_account| can :read, PhoneNumber, :id => sip_account.phone_number_ids - can :manage, CallForward, :call_forwardable_id => sip_account.phone_number_ids - can :manage, Ringtone, :ringtoneable_type => 'PhoneNumber', :ringtoneable_id => sip_account.phone_number_ids - can :manage, Ringtone, :ringtoneable_type => 'SipAccount', :ringtoneable_id => sip_account.id can [:read, :destroy, :call] , CallHistory, :id => sip_account.call_history_ids end can :read, Phone, :phoneable_type => 'User', :phoneable_id => user.id @@ -161,10 +158,17 @@ class Ability can :manage, ConferenceInvitee, :conference_id => conference.id end - # User can manage CallForwards of the PhoneNumbers of his - # own SipAccounts: + # User can manage CallForwards of its SipAccount and PhoneNumbers # - can :manage, CallForward, :call_forwardable_id => user.phone_number_ids + can :manage, CallForward, :call_forwardable_type => 'PhoneNumber', :call_forwardable_id => user.phone_number_ids + can :manage, CallForward, :call_forwardable_type => 'SipAccount', :call_forwardable_id => user.sip_account_ids + can :create, CallForward + + # User can manage Ringtones of its SipAccount and PhoneNumbers + # + can :manage, Ringtone, :ringtoneable_type => 'PhoneNumber', :ringtoneable_id => user.phone_number_ids + can :manage, Ringtone, :ringtoneable_type => 'SipAccount', :ringtoneable_id => user.sip_account_ids + can :create, Ringtone # SoftkeyFunctions # |