-
Notifications
You must be signed in to change notification settings - Fork 2
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
LPS-184639, LPS-184640, LPS-190570 Add a new table to map each folder id with its Permission Template settings #4997
base: master
Are you sure you want to change the base?
Conversation
CI is automatically triggering the following test suites:
|
✔️ ci:test:sf - 1 out of 1 jobs passed in 4 minutesClick here for more details.Base Branch:Branch Name: master Sender Branch:Branch Name: LPS-154515-refactor 1 Successful Jobs:For more details click here. |
Jenkins Build:test-portal-source-format#4881 Jenkins Report:jenkins-report.html Jenkins Suite:sf Pull Request:liferay-lima#4997 Testray Routine:EE Pull Request Testray Importer:publish-testray-report#5615 |
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 work!
BTW, I think that the new module should be added in file module.properties
...in/java/com/liferay/permission/template/service/impl/PermissionTemplateLocalServiceImpl.java
Outdated
Show resolved
Hide resolved
long companyId, long groupId, String className, long classPK, | ||
boolean permissionTemplateEnabled) { | ||
|
||
PermissionTemplate permissionTemplate = fetchPermissionTemplate( |
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.
Only one PermissionTemplate
can exist with the key (className, classPK)
? Or is it possible to have them repeated with a different companyId
or groupId
?
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.
classPK
is typically an auto-incrementing integer guaranteeing unique identifiers for entities of the same class. That's why I think entity duplication based solely on (className, classPK
) is generally improbable.
However, if using companyId, groupId, classNameId
and classPK
to identify the entity, could help avoid a few scenarios where entity duplication might appear to occur.
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.
My concern wasn't about uniqueness of (className, classPK) which I know it should be. My question was about... can the same object (e.g. folder, KB Article, etc.) have different permission propagation settings for different Instances or Sites? Well, now with your change we can allow that 😄
7b657c6
to
725eb71
Compare
Hi @marcogalluzzi, thanks for your comment, I updated the PR, please help take a look. Thanks. |
ci:test:sf |
✔️ ci:test:sf - 1 out of 1 jobs passed in 3 minutesClick here for more details.Base Branch:Branch Name: master Sender Branch:Branch Name: LPS-154515-refactor 1 Successful Jobs:For more details click here. |
Jenkins Build:test-portal-source-format#3049 Jenkins Report:jenkins-report.html Jenkins Suite:sf Pull Request:liferay-lima#4997 Testray Routine:EE Pull Request Testray Importer:publish-testray-report#22259 |
This may take some time to review and to move it forward. Putting it on hold. |
ci:report:27984803 |
Hi team,
Please help review this PR and give your feedback.
cc: @locpham97 @ces-quanhuynh @ces-luannguyen
Previous PR: brianchandotcom#142550
Motivation
LPS-184639 Add a new table to map each folder id with its propagation settings
LPS-184640 Update the checkbox value to the database when creating new Folder
LPS-190570 Make it work with publications
These tickets are subtasks of LPS-154515 As a documents manager I want to set permissions from folders to folders at creation time
Each folder will have a permissions propagation setting, and its value will affect how the permissions of newly created subfolders are determined
Solution
In a new module
permission-template
, creating a new entityPermissionTemplate
to map each folderId with its permission template settings with these columns -companyId
,groupId
,classNameId
,classPK
, andpermissionTemplateEnabled
.classNameId
identifies the kind of thing (see ClassNameLocalService) andclassPK
would be its primkey (e.g. folderId, ...).Publication: Enable change-tracking-enabled to true for
PermissionTemplate
and create two new classes to integrate Liferay Publication Framework -PermissionTemplateCTDisplayRenderer
andPermissionTemplateTableReferenceDefinition
Regards,