diff options
author | Jenkins <jenkins@jenkins.ninjawedding.org> | 2018-04-03 19:17:20 +0000 |
---|---|---|
committer | Jenkins <jenkins@jenkins.ninjawedding.org> | 2018-04-03 19:17:20 +0000 |
commit | 6611100480c86c07972c1223e7231c136966e11d (patch) | |
tree | d6ce7cf9568d13ba0dfc8ee32fd1335e0d053f43 /app/policies | |
parent | 1f5bdd8445f6ba192618288504b74c1df7c09ea6 (diff) | |
parent | d8d42179590db772cc5b1873385cba7e5afe20df (diff) |
Merge remote-tracking branch 'tootsuite/master' into glitchsoc/master
Diffstat (limited to 'app/policies')
-rw-r--r-- | app/policies/account_policy.rb | 4 | ||||
-rw-r--r-- | app/policies/report_note_policy.rb | 17 |
2 files changed, 21 insertions, 0 deletions
diff --git a/app/policies/account_policy.rb b/app/policies/account_policy.rb index 85e2c8419..efabe80d0 100644 --- a/app/policies/account_policy.rb +++ b/app/policies/account_policy.rb @@ -29,6 +29,10 @@ class AccountPolicy < ApplicationPolicy admin? end + def remove_avatar? + staff? + end + def subscribe? admin? end diff --git a/app/policies/report_note_policy.rb b/app/policies/report_note_policy.rb new file mode 100644 index 000000000..694bc096b --- /dev/null +++ b/app/policies/report_note_policy.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class ReportNotePolicy < ApplicationPolicy + def create? + staff? + end + + def destroy? + admin? || owner? + end + + private + + def owner? + record.account_id == current_account&.id + end +end |