lib/generators/chaltron/templates/app/models/ability.rb in chaltron-1.0.10 vs lib/generators/chaltron/templates/app/models/ability.rb in chaltron-1.1.0
- old
+ new
@@ -29,9 +29,13 @@
# See the wiki for details:
# https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities
user ||= User.new
if user.is?(:user_admin)
can :manage, User
+ if Chaltron.ldap_allow_all
+ cannot :edit, User, { provider: 'ldap' }
+ cannot :destroy, User, { provider: 'ldap' }
+ end
can :read, Log, category: 'user_admin'
end
if user.is?(:admin)
can :read, Log
end