implement user creation by admin

This commit is contained in:
Eugene Dubinin 2017-01-10 17:07:28 +02:00 committed by Stella Rouzi
parent f057900fb1
commit 93404d543f
5 changed files with 93 additions and 21 deletions

View file

@ -119,6 +119,9 @@ class Ability
# for admins
can :manage, :all if user.is_admin
# even admin cannot create new users with ICHAIN enabled
cannot [:new, :create], User if ENV['OSEM_ICHAIN_ENABLED'] == 'true'
cannot :revert_object, PaperTrail::Version do |version|
(version.event == 'create' && %w(Conference User Event).include?(version.item_type))
end