Repository navigation
fix(acl): make the domain classes that s2-create-acl-domains generates compare and serialize as the plugin's - #16968
Open
borinquenkid wants to merge 1 commit into
Open
borinquenkid wants to merge 1 commit into
borinquenkid wants to merge 1 commit into
Conversation
…s compare and serialize as the plugin's The templates of AclClass, AclSid, AclEntry and AclObjectIdentity had no @EqualsAndHashCode and did not implement Serializable, unlike the plugin's own domain classes. A generated copy compared by identity, and a generated AclObjectIdentity compared equal to another with a different objectId, because the equality of its base class ignores objectId. The ACL services look ACLs up by that equality, so an object whose ACL exists failed with a NotFoundException. The templates now declare the same equality and serialVersionUID as the domain classes. GeneratedAclDomainsSpec renders each template, compiles it and checks equality, hashCode and Serializable. The script does not overwrite an existing class, so the documentation of s2-create-acl-domains says what to add to a copy generated earlier. Fixes #15927 Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL
jamesfredley
approved these changes
Nov 13, 2026
jamesfredley
left a comment
Contributor
There was a problem hiding this comment.
The generated classes compare and serialize the same way as the plugin's classes. Existing plugin classes are unchanged.
✅ All tests passed ✅🏷️ Commit: c49d2e5 Learn more about TestLens at testlens.app/docs. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #15927 (reported by DamsoftDevelopers; a merge to 7.0.x does not close it, so it is closed by hand once the merge-ups land).
The reporter's cause: the domain classes that
s2-create-acl-domainscopies into an application come from templates, and the templates did not have what the plugin's own domain classes have.AclObjectIdentityhad no@EqualsAndHashCode(includes = 'objectId', callSuper = true), so a generated copy compared equal to another with a differentobjectId: the equality of its base class (AbstractAclObjectIdentity) covers only the class, the parent, the owner andentriesInheriting. The ACL services look ACLs up by that equality, so after a restart a list of more than one object could fail withNotFoundException: Unable to find ACL information for object identity. The other three templates had the same gap: no@EqualsAndHashCode, and none of the four implementedSerializable.Change: the four templates declare the same
@EqualsAndHashCodeincludes,SerializableandserialVersionUIDas the domain classes of the plugin (className;sidandprincipal; identity, order, sid, mask, granting and the audit flags;objectIdwithcallSuper). Their owntoStringis kept.s2-create-acl-domainsdoes not overwrite a class that already exists, so the page of the script in the guide now says what to add to a copy generated earlier.Test: a new
GeneratedAclDomainsSpec(the module had no unit tests; it uses the testing support the module already declares) renders each real template, compiles it under another name and checks equality,hashCodeandSerializable, including that two identities with differentobjectIdare not equal. All four fail without the change, as run in the repo; with it they pass. CodeNarc and rat are clean. CI is off (no ci).Not covered: a running application with a generated copy; the spec checks the classes the templates produce, not the script's rendering.
Two of the three reviewers (matrei, codeconsole, jdaugherty), as 7.0.x is released.
https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL