forked from otwcode/otwarchive
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AO3-6697 Limit roles that can edit known issues (otwcode#4891)
* AO3-6697 Limit roles that can edit known issues * Tests without weird workarounds * Test consolidation and formatting cleanup * Make things translatable * Add missing tests * Hide posts button in admin nav when unauthorised * Fix issue from merge
- Loading branch information
1 parent
453f0e6
commit dfaa140
Showing
9 changed files
with
269 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
class KnownIssuePolicy < ApplicationPolicy | ||
MANAGE_ROLES = %w[superadmin support].freeze | ||
|
||
def admin_index? | ||
user_has_roles?(MANAGE_ROLES) | ||
end | ||
|
||
alias destroy? admin_index? | ||
alias edit? admin_index? | ||
alias create? admin_index? | ||
alias new? admin_index? | ||
alias show? admin_index? | ||
alias update? admin_index? | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.