diff options
| author | Robert | 2017-07-05 11:54:33 +0200 |
|---|---|---|
| committer | Robert | 2017-07-05 11:59:06 +0200 |
| commit | e53aa88c442bd0057c4e0ae66e2684d62d3193ed (patch) | |
| tree | 1ba7c8c082dde92ba215659fde9293e231e7c7df /app/policies/access_link_policy.rb | |
| parent | 841bd65847066e92bf5a4d6de112fed1ada73c1c (diff) | |
| download | chouette-core-e53aa88c442bd0057c4e0ae66e2684d62d3193ed.tar.bz2 | |
Refs: #3478@1h;
- All permissions tied to `!archived?`
- Tests adapted
- Policies refactored
? Is `create?` permission bound to `organisation_match?`
Diffstat (limited to 'app/policies/access_link_policy.rb')
| -rw-r--r-- | app/policies/access_link_policy.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/policies/access_link_policy.rb b/app/policies/access_link_policy.rb index 4c6473f18..a4f0e40e8 100644 --- a/app/policies/access_link_policy.rb +++ b/app/policies/access_link_policy.rb @@ -6,14 +6,14 @@ class AccessLinkPolicy < ApplicationPolicy end def create? - user.has_permission?('access_links.create') # organisation match via referential is checked in the view + !archived? && oragnisation_mathc? && user.has_permission?('access_links.create') end def update? - organisation_match? && user.has_permission?('access_links.edit') + !archived? && organisation_match? && user.has_permission?('access_links.edit') end def destroy? - organisation_match? && user.has_permission?('access_links.destroy') + !archived? && organisation_match? && user.has_permission?('access_links.destroy') end end |
