jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Malzer Ferdinand OSP sIT <Ferdinand.Mal...@s-itsolutions.at>
Subject problem after registering a custom privilege
Date Wed, 02 May 2012 14:13:19 GMT
Hello,
I try to register a custom privileg with the following code.


            session = repository.login(new SimpleCredentials(user, pwd.toCharArray()), workspace);
            JackrabbitWorkspace jrws = (JackrabbitWorkspace) session.getWorkspace();
            PrivilegeManager privMgr = jrws.getPrivilegeManager();
            privMgr.registerPrivilege("gcms_role_chief", false, new String[] {});
            session.save();

The code seems to work fine (it runs with no exception).
The next time when I try to access the repository I get the following exception:

Exception in thread "main" javax.jcr.RepositoryException: Duplicate entry for custom privilege
with name {}gcms_role_chief
	at org.apache.jackrabbit.core.security.authorization.PrivilegeRegistry$CustomPrivilegeStore.load(PrivilegeRegistry.java:1078)
	at org.apache.jackrabbit.core.security.authorization.PrivilegeRegistry$CustomPrivilegeStore.access$100(PrivilegeRegistry.java:1046)
	at org.apache.jackrabbit.core.security.authorization.PrivilegeRegistry.<init>(PrivilegeRegistry.java:165)
	at org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:273)
	at org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:589)
	at at.spardat.jackrabbit.test.DumpRepository.main(DumpRepository.java:46)

Does somebody know how I could register a custom privilege the right way?

Thx in advance!
ferry malzer

Mime
View raw message