diff options
| author | Vlatka Pavisic | 2017-02-06 11:42:12 +0100 | 
|---|---|---|
| committer | Vlatka Pavisic | 2017-02-07 11:25:29 +0100 | 
| commit | d94b1271d147fdb5bbd1e616e116173198e858db (patch) | |
| tree | e1b5631e72e009ffd80fdf4e47159b2b11cd899e /app/policies/application_policy.rb | |
| parent | 9c3095c20aaef122212ed71ce8818e3a18b13308 (diff) | |
| download | chouette-core-d94b1271d147fdb5bbd1e616e116173198e858db.tar.bz2 | |
Refs #2476 : Disable modification and deletion of resources from another referential; in progress
Diffstat (limited to 'app/policies/application_policy.rb')
| -rw-r--r-- | app/policies/application_policy.rb | 4 | 
1 files changed, 4 insertions, 0 deletions
diff --git a/app/policies/application_policy.rb b/app/policies/application_policy.rb index 2a0bbc521..07138b38e 100644 --- a/app/policies/application_policy.rb +++ b/app/policies/application_policy.rb @@ -38,6 +38,10 @@ class ApplicationPolicy      Pundit.policy_scope!(user, record.class)    end +  def organisation_match?(via_referential: false) +    eval("user.organisation == record#{'.referential' if via_referential}.organisation") +  end +    class Scope      attr_reader :user, :scope  | 
