Skip to content
Snippets Groups Projects
Commit d9cfed07 authored by http://jneen.net/'s avatar http://jneen.net/
Browse files

add User#internal? and some global permissions

parent 846e5817
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -350,12 +350,15 @@ class User < ActiveRecord::Base
def ghost
unique_internal(where(ghost: true), 'ghost', 'ghost%s@example.com') do |u|
u.bio = 'This is a "Ghost User", created to hold all issues authored by users that have since been deleted. This user cannot be removed.'
u.state = :blocked
u.name = 'Ghost User'
end
end
end
 
def internal?
ghost?
end
#
# Instance methods
#
Loading
Loading
Loading
Loading
@@ -4,5 +4,11 @@ class GlobalPolicy < BasePolicy
 
can! :create_group if @user.can_create_group
can! :read_users_list
unless @user.blocked? || @user.internal?
can! :log_in
can! :access_api
can! :access_git
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment