BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
38737345
Commit
38737345
authored
Aug 10, 2017
by
http://jneen.net/
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
skip the :read_project check for new_project_member
since we're just adding them as a member, the permission may still return false.
parent
4a3b18cb
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
notification_recipient.rb
app/models/notification_recipient.rb
+6
-1
notification_service.rb
app/services/notification_service.rb
+1
-1
No files found.
app/models/notification_recipient.rb
View file @
38737345
...
...
@@ -6,7 +6,8 @@ class NotificationRecipient
target:
nil
,
acting_user:
nil
,
project:
nil
,
group:
nil
group:
nil
,
skip_read_ability:
false
)
unless
NotificationSetting
.
levels
.
key?
(
type
)
||
type
==
:subscription
raise
ArgumentError
,
"invalid type:
#{
type
.
inspect
}
"
...
...
@@ -19,6 +20,7 @@ class NotificationRecipient
@group
=
group
||
@project
&
.
group
@user
=
user
@type
=
type
@skip_read_ability
=
skip_read_ability
end
def
notification_setting
...
...
@@ -83,6 +85,8 @@ class NotificationRecipient
def
has_access?
DeclarativePolicy
.
subject_scope
do
return
false
unless
user
.
can?
(
:receive_notifications
)
return
true
if
@skip_read_ability
return
false
if
@project
&&
!
user
.
can?
(
:read_project
,
@project
)
return
true
unless
read_ability
...
...
@@ -102,6 +106,7 @@ class NotificationRecipient
private
def
read_ability
return
nil
if
@skip_read_ability
return
@read_ability
if
instance_variable_defined?
(
:@read_ability
)
@read_ability
=
...
...
app/services/notification_service.rb
View file @
38737345
...
...
@@ -244,7 +244,7 @@ class NotificationService
end
def
new_project_member
(
project_member
)
return
true
unless
project_member
.
notifiable?
(
:mention
)
return
true
unless
project_member
.
notifiable?
(
:mention
,
skip_read_ability:
true
)
mailer
.
member_access_granted_email
(
project_member
.
real_source_type
,
project_member
.
id
).
deliver_later
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