-
Notifications
You must be signed in to change notification settings - Fork 499
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AO3-6709 Allow certain admins to access inboxes (#4880)
* AO3-6709 Certain admins can view the user's inbox page * AO3-6709 prevent admins from deleting comments or marking them as read * AO3-6709 Show inbox link on user dashboard only for superadmin and policy and abuse admins * AO3-6709 redirect to homepage with error if js format is requested * AO3-6709 fix rubocop issues * AO3-6709 use i18n standard for sidebar on user dashboard * AO3-6709 use i18n standard for admin only access denied error messages * AO3-6709 fix linting issues * AO3-6709 fix issues with renaming variable * AO3-6709 Use single inbox_comment_policy for controlling access to inbox page for admins --------- Co-authored-by: Brian Austin <brianjaustin@gmail.com>
- Loading branch information
1 parent
6b187f7
commit 634e7fe
Showing
7 changed files
with
261 additions
and
95 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
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,7 @@ | ||
class InboxCommentPolicy < ApplicationPolicy | ||
VIEW_INBOX_ROLES = %w[superadmin policy_and_abuse].freeze | ||
|
||
def show? | ||
user_has_roles?(VIEW_INBOX_ROLES) | ||
end | ||
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
Oops, something went wrong.