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
150e6170
Commit
150e6170
authored
Jul 07, 2017
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename `ref_permissions_for_users` `protected_refs_for_users`
parent
5f2f551c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
17 deletions
+18
-17
app/models/concerns/ee/protected_ref_access.rb
app/models/concerns/ee/protected_ref_access.rb
+3
-3
app/models/license.rb
app/models/license.rb
+5
-4
app/views/projects/protected_branches/_index.html.haml
app/views/projects/protected_branches/_index.html.haml
+1
-1
app/views/projects/settings/repository/show.html.haml
app/views/projects/settings/repository/show.html.haml
+1
-1
spec/features/protected_branches_spec.rb
spec/features/protected_branches_spec.rb
+2
-2
spec/features/protected_tags_spec.rb
spec/features/protected_tags_spec.rb
+2
-2
spec/models/ee/protected_ref_access_spec.rb
spec/models/ee/protected_ref_access_spec.rb
+4
-4
No files found.
app/models/concerns/ee/protected_ref_access.rb
View file @
150e6170
...
...
@@ -20,7 +20,7 @@ module EE
conditions:
->
{
where
(
user_id:
nil
,
group_id:
nil
)
}
}
validates
:group
,
:user
,
absence:
true
,
unless: :
ref_permission
s_for_users_required_and_available
unless: :
protected_ref
s_for_users_required_and_available
scope
:by_user
,
->
(
user
)
{
where
(
user:
user
)
}
scope
:by_group
,
->
(
group
)
{
where
(
group:
group
)
}
...
...
@@ -63,8 +63,8 @@ module EE
#
# If it applies to a user/group we can only skip validation `nil`-validation
# if the feature is available
def
ref_permission
s_for_users_required_and_available
type
!=
:role
&&
project
.
feature_available?
(
:
ref_permission
s_for_users
)
def
protected_ref
s_for_users_required_and_available
type
!=
:role
&&
project
.
feature_available?
(
:
protected_ref
s_for_users
)
end
end
end
app/models/license.rb
View file @
150e6170
...
...
@@ -21,8 +21,8 @@ class License < ActiveRecord::Base
MULTIPLE_ISSUE_ASSIGNEES_FEATURE
=
'GitLab_MultipleIssueAssignees'
.
freeze
MULTIPLE_ISSUE_BOARDS_FEATURE
=
'GitLab_MultipleIssueBoards'
.
freeze
OBJECT_STORAGE_FEATURE
=
'GitLab_ObjectStorage'
.
freeze
PROTECTED_REFS_FOR_USERS_FEATURE
=
'GitLab_RefPermissionsForUsers'
.
freeze
PUSH_RULES_FEATURE
=
'GitLab_PushRules'
.
freeze
REF_PERMISSIONS_FOR_USERS_FEATURE
=
'GitLab_RefPermissionsForUsers'
.
freeze
RELATED_ISSUES_FEATURE
=
'RelatedIssues'
.
freeze
SERVICE_DESK_FEATURE
=
'GitLab_ServiceDesk'
.
freeze
VARIABLE_ENVIRONMENT_SCOPE_FEATURE
=
'GitLab_VariableEnvironmentScope'
.
freeze
...
...
@@ -53,7 +53,8 @@ class License < ActiveRecord::Base
merge_request_squash:
MERGE_REQUEST_SQUASH_FEATURE
,
multiple_issue_assignees:
MULTIPLE_ISSUE_ASSIGNEES_FEATURE
,
multiple_issue_boards:
MULTIPLE_ISSUE_BOARDS_FEATURE
,
ref_permissions_for_users:
REF_PERMISSIONS_FOR_USERS_FEATURE
protected_refs_for_users:
PROTECTED_REFS_FOR_USERS_FEATURE
,
push_rules:
PUSH_RULES_FEATURE
}.
freeze
STARTER_PLAN
=
'starter'
.
freeze
...
...
@@ -78,7 +79,7 @@ class License < ActiveRecord::Base
{
MULTIPLE_ISSUE_ASSIGNEES_FEATURE
=>
1
},
{
MULTIPLE_ISSUE_BOARDS_FEATURE
=>
1
},
{
PUSH_RULES_FEATURE
=>
1
},
{
REF_PERMISSION
S_FOR_USERS_FEATURE
=>
1
},
{
PROTECTED_REF
S_FOR_USERS_FEATURE
=>
1
},
{
RELATED_ISSUES_FEATURE
=>
1
}
].
freeze
...
...
@@ -124,8 +125,8 @@ class License < ActiveRecord::Base
{
MULTIPLE_ISSUE_ASSIGNEES_FEATURE
=>
1
},
{
MULTIPLE_ISSUE_BOARDS_FEATURE
=>
1
},
{
OBJECT_STORAGE_FEATURE
=>
1
},
{
PROTECTED_REFS_FOR_USERS_FEATURE
=>
1
},
{
PUSH_RULES_FEATURE
=>
1
},
{
REF_PERMISSIONS_FOR_USERS_FEATURE
=>
1
},
{
SERVICE_DESK_FEATURE
=>
1
}
].
freeze
...
...
app/views/projects/protected_branches/_index.html.haml
View file @
150e6170
-
expanded
=
Rails
.
env
.
test?
-
content_for
:page_specific_javascripts
do
-
if
@project
.
feature_available?
(
:
ref_permission
s_for_users
,
current_user
)
-
if
@project
.
feature_available?
(
:
protected_ref
s_for_users
,
current_user
)
=
webpack_bundle_tag
(
'ee_protected_branches'
)
-
else
=
webpack_bundle_tag
(
'protected_branches'
)
...
...
app/views/projects/settings/repository/show.html.haml
View file @
150e6170
...
...
@@ -9,7 +9,7 @@
=
render
"projects/push_rules/index"
=
render
"projects/mirrors/show"
-
if
@project
.
feature_available?
(
:
ref_permission
s_for_users
,
current_user
)
-
if
@project
.
feature_available?
(
:
protected_ref
s_for_users
,
current_user
)
=
render
"projects/protected_branches/ee/index"
=
render
"projects/protected_tags/ee/index"
-
else
...
...
spec/features/protected_branches_spec.rb
View file @
150e6170
...
...
@@ -104,7 +104,7 @@ feature 'Protected Branches', feature: true, js: true do
describe
"access control"
do
describe
'with ref permissions for users enabled'
do
before
do
stub_licensed_features
(
ref_permission
s_for_users:
true
)
stub_licensed_features
(
protected_ref
s_for_users:
true
)
end
include_examples
"protected branches > access control > EE"
...
...
@@ -112,7 +112,7 @@ feature 'Protected Branches', feature: true, js: true do
describe
'with ref permissions for users disabled'
do
before
do
stub_licensed_features
(
ref_permission
s_for_users:
false
)
stub_licensed_features
(
protected_ref
s_for_users:
false
)
end
include_examples
"protected branches > access control > CE"
...
...
spec/features/protected_tags_spec.rb
View file @
150e6170
...
...
@@ -108,7 +108,7 @@ feature 'Projected Tags', feature: true, js: true do
describe
"access control"
do
describe
'with ref permissions for users enabled'
do
before
do
stub_licensed_features
(
ref_permission
s_for_users:
true
)
stub_licensed_features
(
protected_ref
s_for_users:
true
)
end
include_examples
"protected tags > access control > EE"
...
...
@@ -116,7 +116,7 @@ feature 'Projected Tags', feature: true, js: true do
describe
'with ref permissions for users disabled'
do
before
do
stub_licensed_features
(
ref_permission
s_for_users:
false
)
stub_licensed_features
(
protected_ref
s_for_users:
false
)
end
include_examples
"protected tags > access control > CE"
...
...
spec/models/ee/protected_ref_access_spec.rb
View file @
150e6170
...
...
@@ -16,9 +16,9 @@ describe EE::ProtectedRefAccess do
expect
(
included_in_class
.
included_modules
).
to
include
(
described_class
)
end
context
'with the `
ref_permission
s_for_users` feature disabled'
do
context
'with the `
protected_ref
s_for_users` feature disabled'
do
before
do
stub_licensed_features
(
ref_permission
s_for_users:
false
)
stub_licensed_features
(
protected_ref
s_for_users:
false
)
end
it
"allows creating an
#{
included_in_class
}
with a group"
do
...
...
@@ -36,9 +36,9 @@ describe EE::ProtectedRefAccess do
end
end
context
'with the `
ref_permission
s_for_users` feature enabled'
do
context
'with the `
protected_ref
s_for_users` feature enabled'
do
before
do
stub_licensed_features
(
ref_permission
s_for_users:
true
)
stub_licensed_features
(
protected_ref
s_for_users:
true
)
end
it
"allows creating an
#{
included_in_class
}
with a group"
do
...
...
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