Commit d9cfed07 authored by http://jneen.net/'s avatar http://jneen.net/

add User#internal? and some global permissions

parent 846e5817
...@@ -350,12 +350,15 @@ class User < ActiveRecord::Base ...@@ -350,12 +350,15 @@ class User < ActiveRecord::Base
def ghost def ghost
unique_internal(where(ghost: true), 'ghost', 'ghost%s@example.com') do |u| 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.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' u.name = 'Ghost User'
end end
end end
end end
def internal?
ghost?
end
# #
# Instance methods # Instance methods
# #
......
...@@ -4,5 +4,11 @@ class GlobalPolicy < BasePolicy ...@@ -4,5 +4,11 @@ class GlobalPolicy < BasePolicy
can! :create_group if @user.can_create_group can! :create_group if @user.can_create_group
can! :read_users_list can! :read_users_list
unless @user.blocked? || @user.internal?
can! :log_in
can! :access_api
can! :access_git
end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment