
|
If you were logged in you would be able to see more operations.
|
|
|
|
Environment:
|
spring 2.0.8, tomcat 5.5.20, java 1.6.0_05
|
|
|
I am converting from Acegi 1.0.3.
This code:
BasePermission.buildFromName(name)
With name having the value "WRITE" (a permission within BasePermission) throws this assertion error:
java.lang.IllegalArgumentException: Unknown permission 'WRITE'
at org.springframework.util.Assert.isTrue(Assert.java:65)
at org.springframework.security.acls.domain.DefaultPermissionFactory.bui
ldFromName(DefaultPermissionFactory.java:108)
at org.springframework.security.acls.domain.AbstractRegisteredPermission
.buildFromName(AbstractRegisteredPermission.java:33)
After a little debugging, the registeredPermissionsByName Map is in fact empty.
I could be wrong, but I believe the problem is that java will call the method in the superclass of BasePermission and not execute the static initializer. I could get around this problem by hacking an inner class to use the BasePermission constructor before using this method (which forces the static initializer to execute).
|
|
Description
|
I am converting from Acegi 1.0.3.
This code:
BasePermission.buildFromName(name)
With name having the value "WRITE" (a permission within BasePermission) throws this assertion error:
java.lang.IllegalArgumentException: Unknown permission 'WRITE'
at org.springframework.util.Assert.isTrue(Assert.java:65)
at org.springframework.security.acls.domain.DefaultPermissionFactory.bui
ldFromName(DefaultPermissionFactory.java:108)
at org.springframework.security.acls.domain.AbstractRegisteredPermission
.buildFromName(AbstractRegisteredPermission.java:33)
After a little debugging, the registeredPermissionsByName Map is in fact empty.
I could be wrong, but I believe the problem is that java will call the method in the superclass of BasePermission and not execute the static initializer. I could get around this problem by hacking an inner class to use the BasePermission constructor before using this method (which forces the static initializer to execute).
|
Show » |
|
Object o = BasePermission.WRITE;
That also forces the static initializer to execute.