on 11-29-2007 3:00 PM
Hi Experts,
I have created an IUser as follows:
com.sap.security.api.IUser user = UMFactory.getUserFactory().getUserByLogonID("Kmuser");
now i m using this user into the following:
IResourceContext resourceContext = new ResourceContext(user);
For this i m getting a compiler error that constructor for ResourceContext(user) doesnt exist.
I did explored and studied about the IUser then i came to know that thare are two types of IUser one is com.sapportals.wcm.util.usermanagement.IUser which is deprecated and the newer one is com.sap.security.api.IUser.
ResourceContext class has all the constructor which takes only the deprecated IUser.
So does SAP APIs provides any other ResourceContext class which Works well with com.sap.security.api.IUser?????
Or is there any way to cast com.sap.security.api.IUser to com.sapportals.wcm.util.usermanagement.IUser????
Please help me out
Help will be appreciated and rewarded
Hi,
To convert com.sap.security.api.IUser to com.sapportals.wcm.util.usermanagement.IUser, you can user the following code:
IUser ep5User =
WPUMFactory.getUserFactory().getEP5User(sapUser);
For me it looks like a security breach if you can create ResourceContext with some others userID.
Regards,
Praveen Gudapati
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Praveen,
I m also getting NullPointerException while using the following statement:
IUser user = WPUMFactory.getServiceUserFactory().getServiceUser("cmadmin_service");
I think i m getting Exception due to this function call "getServiceUser("cmadmin_service")"
Can u tell me the reason?
Wat is "cmadmin_service"?
Does it need any setup on the SAP Server m/c for "cmadmin_service"?
Hi,
It is clear for me that you do not want to create Service user, but just to create a ReosurceContext for the service user <b>cmadmin_service</b>
This is the code to create ReosurceContext for the service user:
Object serviceContext = null;
try {
serviceContext = AccessController.doPrivileged(new PrivilegedExceptionAction() {
public Object run() throws WcmException {
return ResourceFactory.getInstance().getServiceContext("cmadmin_service");
}
});
} catch (PrivilegedActionException e) {
logger.severe(e, "ResourceContext for the technical " + serviceUser +
" user could not be retrieved.");
}
IResourceContext resCtx = (IResourceContext) serviceContext;
Regards,
Praveen Gudapati
Hi,
Login to portal. Check under 'User Administration' -> 'Identity Managment'. Enter the user. Click Go. Select the user from the table. At the bottom, user details will be displayed. Click on Modify button, go to 'Assigned groups' tab. On the right, under 'assigned groups' table, check the above 2 groups. If not present, then search for them in 'available groups' and add to the user. Save it.
Regards,
Harini S
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.