diff options
| author | Teddy Wing | 2017-06-14 18:24:17 +0200 |
|---|---|---|
| committer | Teddy Wing | 2017-06-14 18:24:17 +0200 |
| commit | d2b1ab114348ee0895703cd650734f585b11e781 (patch) | |
| tree | dc90e30d2b828d8395f861b889e6e84b0026a661 /app | |
| parent | 07c50e21b45b8fcf219410cbfb71f1c1e67e81b6 (diff) | |
| download | chouette-core-d2b1ab114348ee0895703cd650734f585b11e781.tar.bz2 | |
TableBuilderHelper::CustomLinks: Fix policy check for unhandled actions
In `#actions_after_policy_check`, we weren't correctly including actions
that weren't handled by the prior policy checks. Thus actions that
weren't [:delete, :edit, :archive, :unarchive] wouldn't get included in
the resulting list of actions.
Fix my logic error.
Refs #3479
Diffstat (limited to 'app')
| -rw-r--r-- | app/helpers/table_builder_helper/custom_links.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/app/helpers/table_builder_helper/custom_links.rb b/app/helpers/table_builder_helper/custom_links.rb index 9703940d6..f47ef1a11 100644 --- a/app/helpers/table_builder_helper/custom_links.rb +++ b/app/helpers/table_builder_helper/custom_links.rb @@ -52,9 +52,7 @@ module TableBuilderHelper !Pundit.policy(@user_context, @obj).present?) || (action == :archive && !@obj.archived?) || (action == :unarchive && @obj.archived?) || - - # TODO: Something wrong here for actions not handled - ([:delete, :edit, :archive, :unarchive].include?(action)) + (![:delete, :edit, :archive, :unarchive].include?(action)) end end end |
