-
Notifications
You must be signed in to change notification settings - Fork 293
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
Improve entity access check for Reader Revenue Manager #9150
Comments
IB ✅ |
Hi @nfmohit, sorry to only spot this now, but while reviewing the PR for this issue I've realised that taking this approach would lead to some problems. Specifically, in the case where the currently selected publication has been deleted, no user would pass the test for module access. Therefore:
Maybe I've missed something, but it looks like we should reconsider the approach. Please take a look and see what you think. |
Thank you for raising these concerns, @techanvil! I spoke with @aaemnnosttv about this as well and we think this would not be a problem.
We use the
At this stage, RRM will not appear as a recoverable module as it is not shareable. If in the future this module does become shareable, we will have to think about this further. I'll add this to my notes. Please let me know what you think, thank you! |
Thanks @nfmohit. That's a great point about using So, the code is totally fine as specced and implemented. Thanks to you and @aaemnnosttv for clarifying, sorry for the false alarm! |
…check Improve RRM entity access check
QA Update
|
Hi @kelvinballoo. You are right. With #9151 merged, the QAB was outdated. I have updated it. Please let me know if you have any other questions, thank you! |
QA Update ✅Thanks for confirming @nfmohit This is verified good. Moving ticket to Approval.
|
Feature Description
Currently, the
Modules\Reader_Revenue_Manager::check_service_entity_access()
method only checks if the current user can make alist
request to the SwG API, which technically does not dictate if they have access to an actual publication.This method should be updated to also include checks to see if the current publication exists in the said
list
response.This should be similar to
Modules\Tag_Manager::check_service_entity_access()
.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
Modules\Reader_Revenue_Manager::check_service_entity_access()
method:listPublications
call should be captured in a new variable, e.g.$publications
.true
unconditionally after the try/catch block, the method should returntrue
only if a publication exists in$publications
with the savedpublicationID
module setting.Modules\Tag_Manager::check_service_entity_access()
for inspiration.Test Coverage
tests/phpunit/integration/Modules/Reader_Revenue_ManagerTest.php
:Tests\Modules\Tag_ManagerTest
for inspiration.QA Brief
rrmModule
feature flag.Changelog entry
The text was updated successfully, but these errors were encountered: