Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AO3-6760 Check admin roles in UnsortedTagsController #4903

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

brianjaustin
Copy link
Member

Pull Request Checklist

Issue

https://otwarchive.atlassian.net/browse/AO3-6760

Purpose

Restricts access to the Unsorted Tags bin to superadmin, policy_and_abuse, and tag_wrangling admins. For the PAC admins, view-only access is allowed; the other two roles have full (view/edit) access.

Copy link
Contributor

@Bilka2 Bilka2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one thing!

@@ -5,13 +5,17 @@ class UnsortedTagsController < ApplicationController
before_action :check_permission_to_wrangle

def index
authorize :wrangling if logged_in_as_admin?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be good to use view_access? directly here instead of going via the action because index is one of the actions where the various wrangling related controllers have different access levels.

That way the index? alias can be removed and we won't have someone accidentally converting e.g. TagWranglersController to using the index? permission and giving more roles access than intended.

Copy link
Contributor

@Bilka2 Bilka2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants