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

Add a check for departmental_editor? permission for user #2517

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

baisa
Copy link
Contributor

@baisa baisa commented Jan 28, 2025

Trello card

This is to enable specifying restriction to access Mainstream content by departments. It is an addition to giving access by matching owning_org_content_ids with users organisation_content_id, to ensure we do not block access for some departments.

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

Follow these steps if you are doing a Rails upgrade.

@baisa baisa force-pushed the add-additional-dept-permission-layer branch from e4606a5 to 8dd95db Compare January 28, 2025 12:28
@baisa baisa force-pushed the add-additional-dept-permission-layer branch 4 times, most recently from 506bb63 to eb72797 Compare February 10, 2025 14:33
@baisa baisa marked this pull request as ready for review February 10, 2025 14:51
Copy link
Contributor

@ellohez ellohez left a comment

Choose a reason for hiding this comment

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

Looking good! Just one question really.

test/models/edition_test.rb Show resolved Hide resolved
def departmental_editor?
permissions.include?("departmental_editor")
end

Copy link
Contributor

Choose a reason for hiding this comment

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

Just wondering, does this have an effect on the before actions that exist in Publisher? I have seen some that currently only check has_editor_permissions?

Copy link
Contributor

@mtaylorgds mtaylorgds left a comment

Choose a reason for hiding this comment

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

I think we could do with some more tweaks to the tests.

@baisa baisa force-pushed the add-additional-dept-permission-layer branch 3 times, most recently from a0fb99a to b0b6e5e Compare February 13, 2025 08:36
This is to enable specifying restriction to access Mainstream content by departments. It is an addition to giving access by matching owning_org_content_ids with users organisation_content_id, to ensure we do not block access for some departments.
@baisa baisa force-pushed the add-additional-dept-permission-layer branch from b0b6e5e to de87ab6 Compare February 13, 2025 16:54
Copy link
Contributor

@mtaylorgds mtaylorgds left a comment

Choose a reason for hiding this comment

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

LGTM

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

Successfully merging this pull request may close these issues.

3 participants