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
Léo-Paul Géneau
gitlab-ce
Commits
eb0a17ba
Commit
eb0a17ba
authored
Aug 24, 2017
by
Maxim Rydkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace `is_team_member?` with `team_member?`
parent
fa030cbc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
app/policies/project_policy.rb
app/policies/project_policy.rb
+3
-3
No files found.
app/policies/project_policy.rb
View file @
eb0a17ba
...
@@ -17,13 +17,13 @@ class ProjectPolicy < BasePolicy
...
@@ -17,13 +17,13 @@ class ProjectPolicy < BasePolicy
desc
"Project has public builds enabled"
desc
"Project has public builds enabled"
condition
(
:public_builds
,
scope: :subject
)
{
project
.
public_builds?
}
condition
(
:public_builds
,
scope: :subject
)
{
project
.
public_builds?
}
# For guest access we use #
is_
team_member? so we can use
# For guest access we use #team_member? so we can use
# project.members, which gets cached in subject scope.
# project.members, which gets cached in subject scope.
# This is safe because team_access_level is guaranteed
# This is safe because team_access_level is guaranteed
# by ProjectAuthorization's validation to be at minimum
# by ProjectAuthorization's validation to be at minimum
# GUEST
# GUEST
desc
"User has guest access"
desc
"User has guest access"
condition
(
:guest
)
{
is_
team_member?
}
condition
(
:guest
)
{
team_member?
}
desc
"User has reporter access"
desc
"User has reporter access"
condition
(
:reporter
)
{
team_access_level
>=
Gitlab
::
Access
::
REPORTER
}
condition
(
:reporter
)
{
team_access_level
>=
Gitlab
::
Access
::
REPORTER
}
...
@@ -293,7 +293,7 @@ class ProjectPolicy < BasePolicy
...
@@ -293,7 +293,7 @@ class ProjectPolicy < BasePolicy
private
private
def
is_
team_member?
def
team_member?
return
false
if
@user
.
nil?
return
false
if
@user
.
nil?
greedy_load_subject
=
false
greedy_load_subject
=
false
...
...
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