feat: remove new library button if user does not have create access for v1 libraries#1216
Conversation
|
Thanks for the pull request, @kaustavb12! What's next?Please work through the following steps to get your changes ready for engineering review: 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. 🔘 Let us know that your PR is ready for review:Who will review my changes?This repository is currently maintained by Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:
When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
3a8deb4 to
a9a4d93
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1216 +/- ##
=======================================
Coverage 92.22% 92.22%
=======================================
Files 1008 1008
Lines 18514 18516 +2
Branches 3947 3949 +2
=======================================
+ Hits 17074 17076 +2
Misses 1371 1371
Partials 69 69 ☔ View full report in Codecov by Sentry. |
|
For V2 libraries, the permissions are all centralized in I do think the rule for "who can create V2 libraries" needs to be updated though; currently it says "any active user" and it should be something more elaborate like "any global staff or (if creator groups are enabled, anyone in the creator group, otherwise any active user)", but expressed using bridgekeeper. CC @jmakowski1123 because I'm not sure on the exact product requirements for who can create V2 libraries. If you don't want to take all that on now @kaustavb12, I think this PR should be updated to be explicitly for V1 only. |
0x29a
left a comment
There was a problem hiding this comment.
👍
- I tested that the new library button isn't visible for users without access.
- I read through the code
|
Firstly sorry for the late reply and thanks a lot for the context on the permissions system for V2 libraries. The main motivation behind this PR was to re-use the existing function which was used in the legacy UI to check access to 'Create Library' button for V1. It would have been nice to implement a common logic for both V1 and V2 instead of creating a technical debt, but as you mentioned the rules for the CAN_CREATE_CONTENT_LIBRARY permission is not finalized yet. For this reason I am inclined to convert this PR to just target V1. But if I have guidance about the intented rules for CAN_CREATE_CONTENT_LIBRARY permission, I would be happy to implement that instead and perhaps use it for both V1 and V2. |
|
@kaustavb12 It's fine with me if you update the PR so it doesn't make any changes that affect v2. I believe @jmakowski1123 is still working to define how permissions are supposed to work in v2 anyways. |
8551ffb to
6954861
Compare
|
@bradenmacdonald @0x29a |
|
I tested this locally and verified that the changes affect only v1 now. LGTM. 👍 |
6954861 to
8877b3e
Compare
…penedx#1216) Part of openedx/axim-engineering#23 This updates the `@edx/brand` alias to point to the `brand-openedx` package at the `openedx` scope. This does not impact imports because this package is used via an alias.
Description
Currently the
New Librarybutton is shown to studio users even if they don't have the required access to create a library. This creates a confusing user experince for the user, since if such an user tries to create a library, they get a error down the UI flow.This PR fixes this behavior for V1 libraries inline with the the legacy Studio UI
Testing instructions
Other information
Private Ref: BB-9077