on 09-20-2005 8:48 AM
Hello,
I am trying to create content in KM using a web service but all I get is a "com.sapportals.wcm.repository.AccessDeniedException: User <myuser> is not authenticated" error.
I have been able to create folders in KM with my web service using a service user (cmadmin_service) but I would like to do it with any user. (Actually I don't know why service users work)
This is my method to create folders:
public String createFolder(String parentRID, String folderName, String user) {
com.sapportals.portal.security.usermanagement.IUser iUser = null;
String respuesta = null;
RID rid = RID.getRID(parentRID);
try {
iUser = WPUMFactory.getUserFactory().getUser(user);
IResourceFactory factory = ResourceFactory.getInstance();
IResourceContext context = new ResourceContext(iUser);
ICollection parent = (ICollection)factory.getResource(rid, context);
ICollection collection = parent.createCollection(folderName, null);
respuesta = collection.getName();
}
catch(Exception e){
respuesta = e.toString();
}
return respuesta;
}
How can I get "myuser" authenticated?
I hope you may help me, Thanks!
Hello Antonio,
Did you check following docs:
https://media.sdn.sap.com/html/submitted_docs/nw_kmc/howto/rf/client_api/rf_client_api.html#Security
Best regards, Maksim Rashchynski.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your reply Maksim.
I have read those documents and tried with this code:
IResourceAclManager aclManager = ((IAclSecurityManager)parent.getRepositoryManager().getSecurityManager(parent)).getAclManager();
IResourceAcl resourceAcl = aclManager.createAcl(parent);
IUMPrincipal principal = WPUMFactory.getUserFactory().getEP5Principal(user);
IAclPermission fullControl = aclManager.getPermission(IAclPermission.ACL_PERMISSION_FULL_CONTROL);
IResourceAclEntry aclEntry = aclManager.createAclEntry(principal, false, fullControl, 0);
resourceAcl.addEntry(aclEntry);
But I get that
parent.getRepositoryManager().getSecurityManager(parent)
is null, so I can't get the IResourceAclManager.I think this happens because the user is not authenticated, so I'm back to the starting point.
Any idea about how to solve this?
Thanks.
Message was edited by: Antonio David Ramírez Moreno
User | Count |
---|---|
71 | |
26 | |
10 | |
9 | |
7 | |
6 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.