-
Notifications
You must be signed in to change notification settings - Fork 6k
ACL: acl_class class vs class_id_type for BasicLookupStrategy conflict #7598
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
Comments
Sorry to hear you are having trouble, @ChristianSch. Since I think these lines: Serializable identifier = (Serializable) rs.getObject("object_id_identity");
identifier = aclClassIdUtils.identifierFrom(identifier, rs); Are the ones in error since they assume that A better approach might be: Serializable identifier;
if (usingDefaultSelectClause) {
identifier = rs.getLong("object_id_identity");
} else {
identifier = (Serializable) rs.getObject("object_id_identity");
identifier = aclClassIdUtils.identifierFrom(identifier, rs);
} Since the original behavior before #4424 was to treat the Would you be interested in submitting a PR to fix the problem? A possible workaround in the meantime might be for you to have both |
Hi, /edit: I found out why my implementation didn't work. First it was using the wrong beans, then I didn't implement I'll need to catch up on my stuff and see what I can gather from this and see if I can contribute something. But as I said, don't wait for it. |
Glad you got things working, @ChristianSch. As a side note, the reference documentation is something we're working on improving - feel free to file a ticket if you have specific recommendations. Regarding the Baeldung article, I know that they are pretty open to you opening issues on their repo so they can update their articles accordingly. |
I have the same issue on Postgrees (spring-boot 2.2.2). I really like the idea, but duo to the lack of proper documentation I moved toward implementing my own PermissionEvaluator for ACL.
|
I think the solutions proposed above are potentially cumbersome. I was able to solve this differently. You must have both the
In addition, when using a non-
and your DDL for
Reference documentation update request: (#7978) |
@jonathan-graf I think updating the documentation is a good idea. I also think that remaining passive is good, too. We didn't require two columns in the past, and we shouldn't suddenly require folks who upgrade to add a new column if we can help it. IMO, you should only need the
Could you expand on this? It's okay for a framework to do cumbersome work so that the app doesn't have to. My proposal is meant to place the upgrade burden on the framework so that the application's upgrade story is simpler. What might not be clear is that my proposal is how to change |
Hi Josh, thanks for getting back to me. I totally agree with you. Upgrading users should not need to add a new column. Only users that want to use UUIDs as identifiers need the new column. I think maybe I didn't describe myself well enough because I am not proposing any new solutions or changes to the framework. The framework code references the To further clarify: the framework, as of version 5.2.2 works. I have not needed to make any changes to the framework to allow UUIDs to be stored as the identifier in the ObjectIdentity. That's why I'm simply recommending that we update the documentation to inform the public that the framework already supports UUIDs as ObjectIdentifiers. I am not sure how changing |
Summary
Hi! I'm trying to use ACL with Spring Boot.
Actual Behavior
I used the schemas as specified here (in this case H2) and I try to use the BasicLookupStrategy. I tried both names,
class
andclass_id_type
for the tableacl_class
, neither work out of the box because BasicLookupStrategy tries to useclass_id_type
ANDclass
, but the schema above specifiesclass
for the column name. Now here's where the strategy tries to actually use both column names:spring-security/acl/src/main/java/org/springframework/security/acls/jdbc/BasicLookupStrategy.java
Line 96 in c1db1aa
spring-security/acl/src/main/java/org/springframework/security/acls/jdbc/BasicLookupStrategy.java
Line 110 in c1db1aa
Is the schema missing something? Am I supposed to implement something else? I don't want to implement my own LookupStrategy just for this.
Expected Behavior
No schema issues, both calls should succeed (see sample).
Configuration
Version
5.2.0.RELEASE
Sample
Leaving the column named
class
causes:schema:
Renaming column to
class_id_type
causes:with code:
schema:
That being said,
AclClassIdUtils
also usesclass_id_type
:spring-security/acl/src/main/java/org/springframework/security/acls/jdbc/AclClassIdUtils.java
Line 39 in c1db1aa
The text was updated successfully, but these errors were encountered: