diff options
author | Sean McGivern <sean@gitlab.com> | 2018-03-02 12:03:03 +0000 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2018-03-02 16:16:13 +0000 |
commit | daeeb7f8480d747d500ea3aeddb479a29e890562 (patch) | |
tree | 9c9a9f02a4f91ab51b8bf60ea6ca3b94f3cced0a /app/services/notes | |
parent | 40c61acb6a9ba84928cebcbce8b57630bd439615 (diff) | |
download | gitlab-ce-daeeb7f8480d747d500ea3aeddb479a29e890562.tar.gz |
Fix quick actions for users who cannot update issues and MRs43334-reply-by-email-did-not-pick-up-unsubscribe-quick-action
There are several quick actions now that don't need this access - /todo and
/unsubscribe for instance - but when these were first added, there
weren't. Quick actions are now responsible for checking their own permissions.
Diffstat (limited to 'app/services/notes')
-rw-r--r-- | app/services/notes/quick_actions_service.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/app/services/notes/quick_actions_service.rb b/app/services/notes/quick_actions_service.rb index a8d0cc15527..0a33d5f3f3d 100644 --- a/app/services/notes/quick_actions_service.rb +++ b/app/services/notes/quick_actions_service.rb @@ -9,14 +9,12 @@ module Notes UPDATE_SERVICES[note.noteable_type] end - def self.supported?(note, current_user) - noteable_update_service(note) && - current_user && - current_user.can?(:"update_#{note.to_ability_name}", note.noteable) + def self.supported?(note) + !!noteable_update_service(note) end def supported?(note) - self.class.supported?(note, current_user) + self.class.supported?(note) end def extract_commands(note, options = {}) |