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
4e826597
Commit
4e826597
authored
Feb 02, 2021
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename duplicated method name on ProjectPolicy
Renames ProjectPolicy#feature_available? to access_allowed_to?
parent
ea8972d4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
app/policies/project_policy.rb
app/policies/project_policy.rb
+3
-3
ee/app/policies/ee/project_policy.rb
ee/app/policies/ee/project_policy.rb
+2
-2
No files found.
app/policies/project_policy.rb
View file @
4e826597
...
...
@@ -82,7 +82,7 @@ class ProjectPolicy < BasePolicy
with_scope
:subject
condition
(
:metrics_dashboard_allowed
)
do
feature_available
?
(
:metrics_dashboard
)
access_allowed_to
?
(
:metrics_dashboard
)
end
with_scope
:global
...
...
@@ -161,7 +161,7 @@ class ProjectPolicy < BasePolicy
features
.
each
do
|
f
|
# these are scored high because they are unlikely
desc
"Project has
#{
f
}
disabled"
condition
(
:"
#{
f
}
_disabled"
,
score:
32
)
{
!
feature_available
?
(
f
.
to_sym
)
}
condition
(
:"
#{
f
}
_disabled"
,
score:
32
)
{
!
access_allowed_to
?
(
f
.
to_sym
)
}
end
# `:read_project` may be prevented in EE, but `:read_project_for_iids` should
...
...
@@ -692,7 +692,7 @@ class ProjectPolicy < BasePolicy
project
.
team
.
max_member_access
(
@user
.
id
)
end
def
feature_available
?
(
feature
)
def
access_allowed_to
?
(
feature
)
return
false
unless
project
.
project_feature
case
project
.
project_feature
.
access_level
(
feature
)
...
...
ee/app/policies/ee/project_policy.rb
View file @
4e826597
...
...
@@ -16,7 +16,7 @@ module EE
condition
(
:iterations_available
)
{
@subject
.
feature_available?
(
:iterations
)
}
with_scope
:subject
condition
(
:requirements_available
)
{
@subject
.
feature_available?
(
:requirements
)
&
feature_available
?
(
:requirements
)
}
condition
(
:requirements_available
)
{
@subject
.
feature_available?
(
:requirements
)
&
access_allowed_to
?
(
:requirements
)
}
condition
(
:compliance_framework_available
)
{
@subject
.
feature_available?
(
:compliance_framework
,
@user
)
}
...
...
@@ -113,7 +113,7 @@ module EE
with_scope
:subject
condition
(
:security_and_compliance_enabled
)
do
@subject
.
feature_available?
(
:security_and_compliance
)
&&
feature_available
?
(
:security_and_compliance
)
@subject
.
feature_available?
(
:security_and_compliance
)
&&
access_allowed_to
?
(
:security_and_compliance
)
end
with_scope
:subject
...
...
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