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
...
@@ -20,7 +20,7 @@ module EE
conditions:
->
{
where
(
user_id:
nil
,
group_id:
nil
)
}
}
conditions:
->
{
where
(
user_id:
nil
,
group_id:
nil
)
}
}
validates
:group
,
:user
,
validates
:group
,
:user
,
absence:
true
,
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_user
,
->
(
user
)
{
where
(
user:
user
)
}
scope
:by_group
,
->
(
group
)
{
where
(
group:
group
)
}
scope
:by_group
,
->
(
group
)
{
where
(
group:
group
)
}
...
@@ -63,8 +63,8 @@ module EE
...
@@ -63,8 +63,8 @@ module EE
#
#
# If it applies to a user/group we can only skip validation `nil`-validation
# If it applies to a user/group we can only skip validation `nil`-validation
# if the feature is available
# if the feature is available
def
ref_permission
s_for_users_required_and_available
def
protected_ref
s_for_users_required_and_available
type
!=
:role
&&
project
.
feature_available?
(
:
ref_permission
s_for_users
)
type
!=
:role
&&
project
.
feature_available?
(
:
protected_ref
s_for_users
)
end
end
end
end
end
end
app/models/license.rb
View file @
150e6170
...
@@ -21,8 +21,8 @@ class License < ActiveRecord::Base
...
@@ -21,8 +21,8 @@ class License < ActiveRecord::Base
MULTIPLE_ISSUE_ASSIGNEES_FEATURE
=
'GitLab_MultipleIssueAssignees'
.
freeze
MULTIPLE_ISSUE_ASSIGNEES_FEATURE
=
'GitLab_MultipleIssueAssignees'
.
freeze
MULTIPLE_ISSUE_BOARDS_FEATURE
=
'GitLab_MultipleIssueBoards'
.
freeze
MULTIPLE_ISSUE_BOARDS_FEATURE
=
'GitLab_MultipleIssueBoards'
.
freeze
OBJECT_STORAGE_FEATURE
=
'GitLab_ObjectStorage'
.
freeze
OBJECT_STORAGE_FEATURE
=
'GitLab_ObjectStorage'
.
freeze
PROTECTED_REFS_FOR_USERS_FEATURE
=
'GitLab_RefPermissionsForUsers'
.
freeze
PUSH_RULES_FEATURE
=
'GitLab_PushRules'
.
freeze
PUSH_RULES_FEATURE
=
'GitLab_PushRules'
.
freeze
REF_PERMISSIONS_FOR_USERS_FEATURE
=
'GitLab_RefPermissionsForUsers'
.
freeze
RELATED_ISSUES_FEATURE
=
'RelatedIssues'
.
freeze
RELATED_ISSUES_FEATURE
=
'RelatedIssues'
.
freeze
SERVICE_DESK_FEATURE
=
'GitLab_ServiceDesk'
.
freeze
SERVICE_DESK_FEATURE
=
'GitLab_ServiceDesk'
.
freeze
VARIABLE_ENVIRONMENT_SCOPE_FEATURE
=
'GitLab_VariableEnvironmentScope'
.
freeze
VARIABLE_ENVIRONMENT_SCOPE_FEATURE
=
'GitLab_VariableEnvironmentScope'
.
freeze
...
@@ -53,7 +53,8 @@ class License < ActiveRecord::Base
...
@@ -53,7 +53,8 @@ class License < ActiveRecord::Base
merge_request_squash:
MERGE_REQUEST_SQUASH_FEATURE
,
merge_request_squash:
MERGE_REQUEST_SQUASH_FEATURE
,
multiple_issue_assignees:
MULTIPLE_ISSUE_ASSIGNEES_FEATURE
,
multiple_issue_assignees:
MULTIPLE_ISSUE_ASSIGNEES_FEATURE
,
multiple_issue_boards:
MULTIPLE_ISSUE_BOARDS_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
}.
freeze
STARTER_PLAN
=
'starter'
.
freeze
STARTER_PLAN
=
'starter'
.
freeze
...
@@ -78,7 +79,7 @@ class License < ActiveRecord::Base
...
@@ -78,7 +79,7 @@ class License < ActiveRecord::Base
{
MULTIPLE_ISSUE_ASSIGNEES_FEATURE
=>
1
},
{
MULTIPLE_ISSUE_ASSIGNEES_FEATURE
=>
1
},
{
MULTIPLE_ISSUE_BOARDS_FEATURE
=>
1
},
{
MULTIPLE_ISSUE_BOARDS_FEATURE
=>
1
},
{
PUSH_RULES_FEATURE
=>
1
},
{
PUSH_RULES_FEATURE
=>
1
},
{
REF_PERMISSION
S_FOR_USERS_FEATURE
=>
1
},
{
PROTECTED_REF
S_FOR_USERS_FEATURE
=>
1
},
{
RELATED_ISSUES_FEATURE
=>
1
}
{
RELATED_ISSUES_FEATURE
=>
1
}
].
freeze
].
freeze
...
@@ -124,8 +125,8 @@ class License < ActiveRecord::Base
...
@@ -124,8 +125,8 @@ class License < ActiveRecord::Base
{
MULTIPLE_ISSUE_ASSIGNEES_FEATURE
=>
1
},
{
MULTIPLE_ISSUE_ASSIGNEES_FEATURE
=>
1
},
{
MULTIPLE_ISSUE_BOARDS_FEATURE
=>
1
},
{
MULTIPLE_ISSUE_BOARDS_FEATURE
=>
1
},
{
OBJECT_STORAGE_FEATURE
=>
1
},
{
OBJECT_STORAGE_FEATURE
=>
1
},
{
PROTECTED_REFS_FOR_USERS_FEATURE
=>
1
},
{
PUSH_RULES_FEATURE
=>
1
},
{
PUSH_RULES_FEATURE
=>
1
},
{
REF_PERMISSIONS_FOR_USERS_FEATURE
=>
1
},
{
SERVICE_DESK_FEATURE
=>
1
}
{
SERVICE_DESK_FEATURE
=>
1
}
].
freeze
].
freeze
...
...
app/views/projects/protected_branches/_index.html.haml
View file @
150e6170
-
expanded
=
Rails
.
env
.
test?
-
expanded
=
Rails
.
env
.
test?
-
content_for
:page_specific_javascripts
do
-
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'
)
=
webpack_bundle_tag
(
'ee_protected_branches'
)
-
else
-
else
=
webpack_bundle_tag
(
'protected_branches'
)
=
webpack_bundle_tag
(
'protected_branches'
)
...
...
app/views/projects/settings/repository/show.html.haml
View file @
150e6170
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
=
render
"projects/push_rules/index"
=
render
"projects/push_rules/index"
=
render
"projects/mirrors/show"
=
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_branches/ee/index"
=
render
"projects/protected_tags/ee/index"
=
render
"projects/protected_tags/ee/index"
-
else
-
else
...
...
spec/features/protected_branches_spec.rb
View file @
150e6170
...
@@ -104,7 +104,7 @@ feature 'Protected Branches', feature: true, js: true do
...
@@ -104,7 +104,7 @@ feature 'Protected Branches', feature: true, js: true do
describe
"access control"
do
describe
"access control"
do
describe
'with ref permissions for users enabled'
do
describe
'with ref permissions for users enabled'
do
before
do
before
do
stub_licensed_features
(
ref_permission
s_for_users:
true
)
stub_licensed_features
(
protected_ref
s_for_users:
true
)
end
end
include_examples
"protected branches > access control > EE"
include_examples
"protected branches > access control > EE"
...
@@ -112,7 +112,7 @@ feature 'Protected Branches', feature: true, js: true do
...
@@ -112,7 +112,7 @@ feature 'Protected Branches', feature: true, js: true do
describe
'with ref permissions for users disabled'
do
describe
'with ref permissions for users disabled'
do
before
do
before
do
stub_licensed_features
(
ref_permission
s_for_users:
false
)
stub_licensed_features
(
protected_ref
s_for_users:
false
)
end
end
include_examples
"protected branches > access control > CE"
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
...
@@ -108,7 +108,7 @@ feature 'Projected Tags', feature: true, js: true do
describe
"access control"
do
describe
"access control"
do
describe
'with ref permissions for users enabled'
do
describe
'with ref permissions for users enabled'
do
before
do
before
do
stub_licensed_features
(
ref_permission
s_for_users:
true
)
stub_licensed_features
(
protected_ref
s_for_users:
true
)
end
end
include_examples
"protected tags > access control > EE"
include_examples
"protected tags > access control > EE"
...
@@ -116,7 +116,7 @@ feature 'Projected Tags', feature: true, js: true do
...
@@ -116,7 +116,7 @@ feature 'Projected Tags', feature: true, js: true do
describe
'with ref permissions for users disabled'
do
describe
'with ref permissions for users disabled'
do
before
do
before
do
stub_licensed_features
(
ref_permission
s_for_users:
false
)
stub_licensed_features
(
protected_ref
s_for_users:
false
)
end
end
include_examples
"protected tags > access control > CE"
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
...
@@ -16,9 +16,9 @@ describe EE::ProtectedRefAccess do
expect
(
included_in_class
.
included_modules
).
to
include
(
described_class
)
expect
(
included_in_class
.
included_modules
).
to
include
(
described_class
)
end
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
before
do
stub_licensed_features
(
ref_permission
s_for_users:
false
)
stub_licensed_features
(
protected_ref
s_for_users:
false
)
end
end
it
"allows creating an
#{
included_in_class
}
with a group"
do
it
"allows creating an
#{
included_in_class
}
with a group"
do
...
@@ -36,9 +36,9 @@ describe EE::ProtectedRefAccess do
...
@@ -36,9 +36,9 @@ describe EE::ProtectedRefAccess do
end
end
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
before
do
stub_licensed_features
(
ref_permission
s_for_users:
true
)
stub_licensed_features
(
protected_ref
s_for_users:
true
)
end
end
it
"allows creating an
#{
included_in_class
}
with a group"
do
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