-
Notifications
You must be signed in to change notification settings - Fork 273
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
UP-4966 Implement lifecycle state BROWSE permissions #1068
Conversation
Replicate the portlet SUBSCRIBE permission model for portlet BROWSE permissions so that expired portlets cannot be browsed by non-admin users in the marketplace or searched for using the portal search.
I can see that this pull request is failing checks, specifically formatting according to the Google Java Style. Unfortunately I cannot tell why this check is failing from the task output as it just refers to 'formatting style violations' so I haven't managed to fix this yet. If anyone can help with this, it would be fantastic. I'm using IntelliJ IDEA 2017.3 but the google-java-format plugin isn't working for me and having looked through the Google Java Style guidelines manually I can't see what I'm doing wrong. |
Style can be automatically handled by running the Google Style formatter from Gradle. ./gradlew goJF |
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.
Thanks @mairi! 🙇
Code LGTM ✅
I'll defer to others on API/Configuration design around the portlet lifecycle.
Thanks for that tip @ChristianMurphy! I eventually figured out what I was doing wrong with IntelliJ & got the check task passing locally. Now just waiting to see if it passes here! |
Merge required to resolve test failure by pulling in UP-4978 changes.
This PR looks very good and very thorough. 👍 I'm going to pull it down locally and kick the tires. |
Tested locally -- everything seems to work swimmingly. |
Replicate the portlet SUBSCRIBE permission model for portlet BROWSE permissions so that expired portlets cannot be browsed by non-admin users in the marketplace or searched for using the portal search.
Checklist
Description of change
The BROWSE permission which governs access to portlets in search, Customize, and in the Marketplace has been updated to take account of portlet lifecycle state in the same manner as the SUBSCRIBE permission, thereby preventing non-admin users from seeing unpublished portlets. This reflects the normal expectation that setting a portlet to expired means it is no longer visible, overriding other permissions.
Changes are as follows:
Note that the original UP-4966 issue only mentions restricting browse for expired portlets, but it seemed to make sense to avoid confusion and simply mirror the behaviour for SUBSCRIBE permissions.
After applying these changes locally:
Tests & Documentation
I have left the Checklist items for tests and documentation in place and unchecked above as I'm not sure whether action is required for these. I couldn't find any tests that ought to be updated - all tests are passing when I run './gradlew test' - and I wasn't sure what new tests might be required or where to add them. For documentation, again I'm not confident about what will need to be changed. Any guidance on these two items would be most welcome!
Impact on uPortal-start
If the change in this pull request is accepted, a corresponding change in uPortal-start will be required. The file which defines the BROWSE & SUBSCRIBE permissions that control rendering of and subscription to uPortal content, UP_PORTLET_SUBSCRIBE.permission-owner.xml, is no longer part of uPortal. It now exists in uPortal-start in data/base/permission_owner. This file requires activity element definitions for the Browse Approved (BROWSE_APPROVED), Browse Created (BROWSE_CREATED) and Browse Expired (BROWSE_EXPIRED) permissions, for example:
`
`