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
de629b48
Commit
de629b48
authored
Mar 09, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Blocking user does not remove him/her from project/groups but show blocked label
parent
fcaf0a89
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
22 deletions
+9
-22
CHANGELOG
CHANGELOG
+1
-0
app/models/user.rb
app/models/user.rb
+1
-19
app/services/notification_service.rb
app/services/notification_service.rb
+1
-0
app/views/admin/users/show.html.haml
app/views/admin/users/show.html.haml
+0
-1
app/views/groups/group_members/_group_member.html.haml
app/views/groups/group_members/_group_member.html.haml
+3
-0
app/views/projects/team_members/_team_member.html.haml
app/views/projects/team_members/_team_member.html.haml
+3
-2
No files found.
CHANGELOG
View file @
de629b48
...
@@ -34,6 +34,7 @@ v 7.9.0 (unreleased)
...
@@ -34,6 +34,7 @@ v 7.9.0 (unreleased)
- Automatically link commit ranges to compare page: sha1...sha4 or sha1..sha4 (includes sha1 in comparison)
- Automatically link commit ranges to compare page: sha1...sha4 or sha1..sha4 (includes sha1 in comparison)
- Move groups page from profile to dashboard
- Move groups page from profile to dashboard
- Starred projects page at dashboard
- Starred projects page at dashboard
- Blocking user does not remove him/her from project/groups but show blocked label
v 7.8.2
v 7.8.2
- Fix service migration issue when upgrading from versions prior to 7.3
- Fix service migration issue when upgrading from versions prior to 7.3
...
...
app/models/user.rb
View file @
de629b48
...
@@ -154,24 +154,6 @@ class User < ActiveRecord::Base
...
@@ -154,24 +154,6 @@ class User < ActiveRecord::Base
delegate
:path
,
to: :namespace
,
allow_nil:
true
,
prefix:
true
delegate
:path
,
to: :namespace
,
allow_nil:
true
,
prefix:
true
state_machine
:state
,
initial: :active
do
state_machine
:state
,
initial: :active
do
after_transition
any
=>
:blocked
do
|
user
,
transition
|
# Remove user from all projects and
user
.
project_members
.
find_each
do
|
membership
|
# skip owned resources
next
if
membership
.
project
.
owner
==
user
return
false
unless
membership
.
destroy
end
# Remove user from all groups
user
.
group_members
.
find_each
do
|
membership
|
# skip owned resources
next
if
membership
.
group
.
last_owner?
(
user
)
return
false
unless
membership
.
destroy
end
end
event
:block
do
event
:block
do
transition
active: :blocked
transition
active: :blocked
end
end
...
...
app/services/notification_service.rb
View file @
de629b48
...
@@ -268,6 +268,7 @@ class NotificationService
...
@@ -268,6 +268,7 @@ class NotificationService
# Also remove duplications and nil recipients
# Also remove duplications and nil recipients
def
reject_muted_users
(
users
,
project
=
nil
)
def
reject_muted_users
(
users
,
project
=
nil
)
users
=
users
.
to_a
.
compact
.
uniq
users
=
users
.
to_a
.
compact
.
uniq
users
=
users
.
reject
(
&
:blocked?
)
users
.
reject
do
|
user
|
users
.
reject
do
|
user
|
next
user
.
notification
.
disabled?
unless
project
next
user
.
notification
.
disabled?
unless
project
...
...
app/views/admin/users/show.html.haml
View file @
de629b48
...
@@ -116,7 +116,6 @@
...
@@ -116,7 +116,6 @@
%ul
%ul
%li
User will not be able to login
%li
User will not be able to login
%li
User will not be able to access git repositories
%li
User will not be able to access git repositories
%li
User will be removed from joined projects and groups
%li
Personal projects will be left
%li
Personal projects will be left
%li
Owned groups will be left
%li
Owned groups will be left
%br
%br
...
...
app/views/groups/group_members/_group_member.html.haml
View file @
de629b48
...
@@ -8,6 +8,9 @@
...
@@ -8,6 +8,9 @@
%span
.cgray
=
user
.
username
%span
.cgray
=
user
.
username
-
if
user
==
current_user
-
if
user
==
current_user
%span
.label.label-success
It's you
%span
.label.label-success
It's you
-
if
user
.
blocked?
%label
.label.label-danger
%strong
Blocked
-
if
show_roles
-
if
show_roles
%span
.pull-right
%span
.pull-right
...
...
app/views/projects/team_members/_team_member.html.haml
View file @
de629b48
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
=
image_tag
avatar_icon
(
user
.
email
,
32
),
class:
"avatar s32"
=
image_tag
avatar_icon
(
user
.
email
,
32
),
class:
"avatar s32"
%p
%p
%strong
=
user
.
name
%strong
=
user
.
name
-
if
user
.
blocked?
%label
.label.label-danger
%strong
Blocked
%span
.cgray
=
user
.
username
%span
.cgray
=
user
.
username
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