MarvinB
MarvinB

Reputation: 87

AclClassIdUtils : Unable to obtain the class id type

I have integrated configuration code for ACL on a permission level for my entities. Everything works fine and it even checks if a user holds a particular permission and denies/allows access based on their roles. But whenever a permission is checked I get the following error in the console which I would like to eliminate.

I already tried to add the column class_id_type to the acl_class but that did not change anything.

@Column(name = "class_id_type")
@Null
private String classIdType;

I am using

compile group: 'org.springframework.security', name: 'spring-security-core', version: '5.1.2.RELEASE'

2019-05-21 13:42:17.593 DEBUG 4036 --- [nio-8080-exec-4] o.s.security.acls.jdbc.AclClassIdUtils   : Unable to obtain the class id type

org.postgresql.util.PSQLException: The column name class_id_type was not found in this ResultSet.

Upvotes: 1

Views: 641

Answers (1)

Lijianlin Li
Lijianlin Li

Reputation: 11

class_id_type is selected from acl_class in default BasicLookupStrategy, but column class_id_type column has been changed to class in spring security official site (https://docs.spring.io/spring-security/site/docs/4.0.4.RELEASE/reference/html/appendix-schema.html#dbschema-acl)

create table acl_class(
    id    bigint generated by default as identity(start with 100) not null primary key,
    class varchar_ignorecase(100) not null,
    
    constraint unique_uk_2 unique(class)
);

So, just create yourself: public class MyLookupStrategy implementing LookupStrategy from BasicLookupStrategy, and public class MyAclClassIdUtils from AclClassIdUtils

then change class_id_type to class, it should works then.

Upvotes: 1

Related Questions