Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d9cfed07
Commit
d9cfed07
authored
Feb 28, 2017
by
http://jneen.net/
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add User#internal? and some global permissions
parent
846e5817
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
app/models/user.rb
app/models/user.rb
+4
-1
app/policies/global_policy.rb
app/policies/global_policy.rb
+6
-0
No files found.
app/models/user.rb
View file @
d9cfed07
...
@@ -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
#
#
...
...
app/policies/global_policy.rb
View file @
d9cfed07
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment