-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Chrome: Hide Sidebar Panels if the user don't have the right capabilities #2585
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2585 +/- ##
==========================================
+ Coverage 31.42% 32.63% +1.21%
==========================================
Files 177 178 +1
Lines 5407 5531 +124
Branches 946 959 +13
==========================================
+ Hits 1699 1805 +106
- Misses 3135 3150 +15
- Partials 573 576 +3
Continue to review full report at Codecov.
|
5b6569b
to
6e56d7b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👍
One issue, which I expect is present on master, is that the author dropdown does not show (correctly) for contributor role, but only because it attempts to make the API request for users and fails. Up to you if you'd like to address that here or separately.
Do you mean, instead of relying on the available users, we should rely on the capabilities? |
@aduth I went ahead and updated to add the capability check. but the API request is still being fetched, because it's declared on the same |
Yeah, either of those seem worth exploring. There should ideally be no 403 requests issued if we know they can be avoided. |
If the user doesn't have the "publish_posts" capability (a contributor), several panel sidebars should be hidden.
In this PR I'm hiding the "pending" toggle, the "schedule" panel and the post visibility is not editable. (similar to the current editor)