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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
f16de8ac
Commit
f16de8ac
authored
Mar 11, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:gitlabhq/gitlabhq
parents
767f7d9a
ae68a66a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
3 deletions
+4
-3
app/models/ability.rb
app/models/ability.rb
+1
-0
features/group.feature
features/group.feature
+1
-1
lib/gitlab/regex.rb
lib/gitlab/regex.rb
+2
-2
No files found.
app/models/ability.rb
View file @
f16de8ac
...
@@ -240,6 +240,7 @@ class Ability
...
@@ -240,6 +240,7 @@ class Ability
can_manage
=
group_abilities
(
user
,
group
).
include?
(
:manage_group
)
can_manage
=
group_abilities
(
user
,
group
).
include?
(
:manage_group
)
if
can_manage
&&
(
user
!=
target_user
)
if
can_manage
&&
(
user
!=
target_user
)
rules
<<
:modify
rules
<<
:modify
rules
<<
:destroy
end
end
if
!
group
.
last_owner?
(
user
)
&&
(
can_manage
||
(
user
==
target_user
))
if
!
group
.
last_owner?
(
user
)
&&
(
can_manage
||
(
user
==
target_user
))
rules
<<
:destroy
rules
<<
:destroy
...
...
features/group.feature
View file @
f16de8ac
...
@@ -74,7 +74,7 @@ Feature: Groups
...
@@ -74,7 +74,7 @@ Feature: Groups
When
I visit group
"Owned"
members page
When
I visit group
"Owned"
members page
Then
I should see user
"John Doe"
in team list
Then
I should see user
"John Doe"
in team list
Then
I should see user
"Mary Jane"
in team list
Then
I should see user
"Mary Jane"
in team list
Then
I should not see the
"Remove User From Group"
button for
"
Mary Jan
e"
Then
I should not see the
"Remove User From Group"
button for
"
John Do
e"
@javascript
@javascript
Scenario
:
Guest should be able to remove himself from group
Scenario
:
Guest should be able to remove himself from group
...
...
lib/gitlab/regex.rb
View file @
f16de8ac
...
@@ -7,7 +7,7 @@ module Gitlab
...
@@ -7,7 +7,7 @@ module Gitlab
end
end
def
project_name_regex
def
project_name_regex
/\A[a-zA-Z0-9][a-zA-Z0-9_\-\. ]*\z/
/\A[a-zA-Z0-9
_
][a-zA-Z0-9_\-\. ]*\z/
end
end
def
name_regex
def
name_regex
...
@@ -49,7 +49,7 @@ module Gitlab
...
@@ -49,7 +49,7 @@ module Gitlab
protected
protected
def
default_regex
def
default_regex
/\A[.?]?[a-zA-Z0-9][a-zA-Z0-9_\-\.]*(?<!\.git)\z/
/\A[.?]?[a-zA-Z0-9
_
][a-zA-Z0-9_\-\.]*(?<!\.git)\z/
end
end
end
end
end
end
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