-
Notifications
You must be signed in to change notification settings - Fork 82
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
ACS-5506 Add description and hasSubgroups to groups API #2035
ACS-5506 Add description and hasSubgroups to groups API #2035
Conversation
6c09f8e
to
e3c18b3
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.
I've had some remarks and thin the code needs some changes.
remote-api/src/main/java/org/alfresco/rest/api/impl/GroupsImpl.java
Outdated
Show resolved
Hide resolved
remote-api/src/main/java/org/alfresco/rest/api/impl/GroupsImpl.java
Outdated
Show resolved
Hide resolved
remote-api/src/main/java/org/alfresco/rest/api/impl/GroupsImpl.java
Outdated
Show resolved
Hide resolved
remote-api/src/main/java/org/alfresco/rest/api/impl/GroupsImpl.java
Outdated
Show resolved
Hide resolved
remote-api/src/main/java/org/alfresco/rest/api/impl/GroupsImpl.java
Outdated
Show resolved
Hide resolved
remote-api/src/main/java/org/alfresco/rest/api/impl/GroupsImpl.java
Outdated
Show resolved
Hide resolved
353b18d
to
e0e2f74
Compare
remote-api/src/main/java/org/alfresco/rest/api/impl/GroupsImpl.java
Dismissed
Show dismissed
Hide dismissed
remote-api/src/main/java/org/alfresco/rest/api/impl/GroupsImpl.java
Dismissed
Show dismissed
Hide dismissed
repository/src/test/java/org/alfresco/repo/security/authority/AuthorityServiceTest.java
Fixed
Show fixed
Hide fixed
repository/src/test/java/org/alfresco/repo/security/authority/AuthorityServiceTest.java
Fixed
Show fixed
Hide fixed
repository/src/test/java/org/alfresco/repo/security/authority/AuthorityServiceTest.java
Fixed
Show fixed
Hide fixed
repository/src/test/java/org/alfresco/repo/security/authority/AuthorityServiceTest.java
Fixed
Show fixed
Hide fixed
repository/src/test/java/org/alfresco/repo/security/authority/AuthorityServiceTest.java
Fixed
Show fixed
Hide fixed
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.
I don't like the asymmetry of this solution. We are relying on the AuthorityDAO
to persist the group description, but I think the only way to retrieve it is with the NodeService
. I think description is a reasonable field to add to the group object AuthorityInfo
(providing it can continue to be unset) or alternatively we could just use the NodeService
to set and retrieve it? (within a single transaction) Nb. AuthorityInfo
is part of the @AlfrescoPublicApi
and so we need to preserve the existing constructor.
The hasSubgroups
flag requires extra service calls to populate and so should be an include
parameter in the API.
9e43682
to
d3c7342
Compare
repository/src/main/java/org/alfresco/repo/security/authority/AuthorityDAOImpl.java
Fixed
Show fixed
Hide fixed
repository/src/main/java/org/alfresco/repo/security/authority/AuthorityDAOImpl.java
Fixed
Show fixed
Hide fixed
repository/src/main/java/org/alfresco/repo/security/authority/AuthorityServiceImpl.java
Fixed
Show fixed
Hide fixed
repository/src/main/java/org/alfresco/repo/security/authority/AuthorityServiceImpl.java
Fixed
Show fixed
Hide fixed
repository/src/test/java/org/alfresco/repo/security/authority/AuthorityServiceTest.java
Fixed
Show fixed
Hide fixed
repository/src/test/java/org/alfresco/repo/security/authority/AuthorityServiceTest.java
Fixed
Show fixed
Hide fixed
packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/groups/GroupsTests.java
Outdated
Show resolved
Hide resolved
repository/src/main/java/org/alfresco/repo/security/authority/AuthorityDAOImpl.java
Outdated
Show resolved
Hide resolved
repository/src/main/java/org/alfresco/repo/security/authority/AuthorityDAOImpl.java
Show resolved
Hide resolved
repository/src/main/java/org/alfresco/repo/security/authority/AuthorityDAOImpl.java
Outdated
Show resolved
Hide resolved
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.
This looks much better now and I don't think it should have any performance implications for existing integrations (since both new fields are behind include
flags). You mentioned looking at canned queries, which could improve the performance when loading both the description and display name.
LGTM 👍
remote-api/src/test/java/org/alfresco/rest/api/tests/client/data/Group.java
Fixed
Show fixed
Hide fixed
repository/src/main/java/org/alfresco/repo/security/authority/AuthorityServiceImpl.java
Fixed
Show fixed
Hide fixed
remote-api/src/test/java/org/alfresco/rest/api/tests/client/data/Group.java
Fixed
Show fixed
Hide fixed
repository/src/main/java/org/alfresco/repo/security/authority/AuthorityServiceImpl.java
Fixed
Show fixed
Hide fixed
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.
LGTM
See https://alfresco.atlassian.net/browse/ACS-5506