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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
29440228
Commit
29440228
authored
Aug 16, 2016
by
http://jneen.net/
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trim more dead code
parent
ccfa032e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
52 deletions
+1
-52
app/models/ability.rb
app/models/ability.rb
+1
-52
No files found.
app/models/ability.rb
View file @
29440228
...
@@ -96,57 +96,6 @@ class Ability
...
@@ -96,57 +96,6 @@ class Ability
end
end
end
end
def
anonymous_project_abilities
(
subject
)
project
=
if
subject
.
is_a?
(
Project
)
subject
else
subject
.
project
end
if
project
&&
project
.
public?
rules
=
[
:read_project
,
:read_board
,
:read_list
,
:read_wiki
,
:read_label
,
:read_milestone
,
:read_project_snippet
,
:read_project_member
,
:read_merge_request
,
:read_note
,
:read_pipeline
,
:read_commit_status
,
:read_container_image
,
:download_code
]
# Allow to read builds by anonymous user if guests are allowed
rules
<<
:read_build
if
project
.
public_builds?
# Allow to read issues by anonymous user if issue is not confidential
rules
<<
:read_issue
unless
subject
.
is_a?
(
Issue
)
&&
subject
.
confidential?
rules
-
project_disabled_features_rules
(
project
)
else
[]
end
end
def
anonymous_group_abilities
(
subject
)
rules
=
[]
group
=
if
subject
.
is_a?
(
Group
)
subject
else
subject
.
group
end
rules
<<
:read_group
if
group
.
public?
rules
end
def
anonymous_user_abilities
def
anonymous_user_abilities
[
:read_user
]
unless
restricted_public_level?
[
:read_user
]
unless
restricted_public_level?
end
end
...
@@ -211,7 +160,7 @@ class Ability
...
@@ -211,7 +160,7 @@ class Ability
project
=
subject
.
project
project
=
subject
.
project
unless
target_user
==
project
.
owner
unless
target_user
==
project
.
owner
can_manage
=
project_abilities
(
user
,
project
).
include?
(
:admin_project_member
)
can_manage
=
allowed?
(
user
,
:admin_project_member
,
project
)
if
can_manage
if
can_manage
rules
<<
:update_project_member
rules
<<
:update_project_member
...
...
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