Skip to Content
author's profile photo Former Member
Former Member

ResourceContext(IUser) constructor is undefined,problem of Deprecated IUser

Hi Experts,

I have created an IUser as follows: 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

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

Or is there any way to cast to com.sapportals.wcm.util.usermanagement.IUser????

Please help me out

Help will be appreciated and rewarded

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Nov 29, 2007 at 04:30 PM


    To convert to com.sapportals.wcm.util.usermanagement.IUser, you can user the following code:

    IUser ep5User =


    For me it looks like a security breach if you can create ResourceContext with some others userID.


    Praveen Gudapati

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Praveen,

      The user through which i logged in have both the above grps checked.

      But tthe code which u gave for Getting resourceContxt for cmadmin_service is independent of any IUser.

      So i m not getting for which user the code is throwing the exception of PrevilegeActionException????

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.