Skip to Content
0
Former Member
Nov 24, 2006 at 10:20 AM

How can I ge user when I developing room extension

22 Views

HI guys,

I am developing room extension, and want to add an ACL to my collection.

I get an "AccessDeniedException" error, when I try to create a new collection:

here is my code:

IResourceFactory resFactory = ResourceFactory.getInstance();

IResourceContext resContext = resFactory.getServiceContext();

userID = resContext.getUser();

String userName = userID.getDisplayName();

resource = (ICollection) resFactory.getResource(RID.getRID(structureRid),true,resContext);

try{userDirResource = resource.createCollection(userID.getId(),null);

}

catch(NotSupportedException e){}

catch(AccessDeniedException e){}

catch(ResourceException e){}

aclMan =((IAclSecurityManager) userDirResource.getRepositoryManager().getSecurityManager(userDirResource)).getAclManager();

userDirResourceAcl = aclMan.getAcl(userDirResource);

IResourceAclEntryList aclList = userDirResourceAcl.getEntries();

IResourceAclEntryListIterator i = aclList.iterator();

Can u give me some hint?

Thanks in advance!

Regards,

liying