aboutsummaryrefslogtreecommitdiffstats
path: root/app/policies/acces_point_policy.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/policies/acces_point_policy.rb')
-rw-r--r--app/policies/acces_point_policy.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/app/policies/acces_point_policy.rb b/app/policies/acces_point_policy.rb
new file mode 100644
index 000000000..ce3a8a1ef
--- /dev/null
+++ b/app/policies/acces_point_policy.rb
@@ -0,0 +1,25 @@
+class AccessPointPolicy < ApplicationPolicy
+ class Scope < Scope
+ def resolve
+ scope
+ end
+ end
+
+ def create?
+ !archived? &&
+ organisation_match? &&
+ user.has_permission?('access_points.create')
+ end
+
+ def update?
+ !archived? &&
+ organisation_match? &&
+ user.has_permission?('access_points.edit')
+ end
+
+ def destroy?
+ !archived? &&
+ organisation_match?
+ && user.has_permission?('access_points.destroy')
+ end
+end