看看界面ObjectIdentity
。它表示在系统中受保护的对象。
/**
* Obtains the actual identifier. This identifier must not be reused to represent other domain objects with
* the same javaType.
*
* Because ACLs are largely immutable, it is strongly recommended to use
* a synthetic identifier (such as a database sequence number for the primary key). Do not use an identifier with
* business meaning, as that business meaning may change in the future such change will cascade to the ACL
* subsystem data.
*
* @return the identifier (unique within this type; never null)
*/
Serializable getIdentifier();
/**
* Obtains the "type" metadata for the domain object. This will often be a Java type name (an interface or a class)
* – traditionally it is the name of the domain object implementation class.
*
* @return the "type" of the domain object (never null).
*/
String getType();
正如您所见,Spring Security使用Serializable
来描述标识符的类型。 所以有可能使用带类名的字符串。
您将需要更新SQL模式为春季安全的作者认为大多数人会通过长/整数ID识别物体。
create table acl_object_identity(
...
object_id_class bigint not null,
object_id_identity bigint not null,
正如我检查,JdbcMutableAclService
能,因为它仅使用ObjectIdentity
接口来处理定制。
研究org.springframework.security.acls
包的源代码。