2016-08-16 19:29:19 -04:00
|
|
|
class GlobalPolicy < BasePolicy
|
|
|
|
def rules
|
|
|
|
return unless @user
|
2016-08-30 14:14:07 -04:00
|
|
|
|
2016-08-16 19:29:19 -04:00
|
|
|
can! :create_group if @user.can_create_group
|
|
|
|
can! :read_users_list
|
2017-02-28 16:09:23 -05:00
|
|
|
|
|
|
|
unless @user.blocked? || @user.internal?
|
2017-02-28 16:19:52 -05:00
|
|
|
can! :log_in unless @user.access_locked?
|
2017-02-28 16:09:23 -05:00
|
|
|
can! :access_api
|
|
|
|
can! :access_git
|
2017-02-28 18:24:04 -05:00
|
|
|
can! :receive_notifications
|
2017-02-28 16:09:23 -05:00
|
|
|
end
|
2016-08-16 19:29:19 -04:00
|
|
|
end
|
|
|
|
end
|