To get the Roles, Worksets, iviews assigned to portal user using webdynpro

Hi..
I need to display the roles, worksets, pages and iviews that are assigned to a particular portal user using WebDynpro.
I tried to search in SDN and found a few blogs on this... but all are for DynPages. I could not find any inputs on how to achieve this in Webdynpro.
I am listing down the blogs for your reference :
1) /people/prakash.singh4/blog/2005/07/28/browse-roles-folders-pages-iviews-assigned-to-a-user-ep6-sp9-and-higher
2) /people/prakash.singh4/blog/2005/09/06/create-a-sitemap-for-your-portal
Please provide me your suggestions on how to display the roles, worksets, pages and iviews that are assigned to a particular portal user using WebDynpro.
Thanks and Regards,
Sayan Ghosh

Please use following code to get all roles assigned to user:
     IWDClientUser wdUser = WDClientUser.forceLoggedInClientUser();
     IUser user = wdUser.getSAPUser();
     String strRoleID = "", strRoleDesc = "";
     IRoleFactory iRoleFactory;
     iRoleFactory = UMFactory.getRoleFactory();
     // Get All the Roles of the User
     Iterator iteratorRoles = user.getRoles(true);//prtRequest.getUser().getRoles(true);
     // Loop through all the Roles
     while(iteratorRoles.hasNext())
          strRoleID = iteratorRoles.next().toString();
          try
               strRoleDesc = iRoleFactory.getRole(strRoleID).getDescription();
               wdComponentAPI.getMessageManager().reportSuccess("Role: "+strRoleDesc);
          catch(Exception e)
               wdComponentAPI.getMessageManager().reportException("Exception e: "+e, false);

Similar Messages

  • How to get the total time spent by a Portal User for a given Date?

    Hello,
    We need to develop a Daily Audit Track Report that displays
    the Users logged into our System for a given day and the total login duration in Hours( should include all the
    Login-Logouts of a given date).
    While Portal30_SSO.WWSSO_AUDIT_LOG_TABLE$ can help me get the Users login to Portal for a day, there is no Login/Logout periods in it.
    Any help would be appreciated.
    Thanks
    Madhav

    You may want to consult with the view WWLOG_ACTIVITY_LOGS. Not sure how your environment is configured, but ours includes two WWLOG_ACTIVITY_LOG tables (1 & 2). These tables purge themselves based on your configuration. In other words, Portal will log activity in WWLOG_ACTIVITY_LOG1$ for a certain period of time, then switch to WWLOG_ACTIVITY_LOG2$ while purging the first one. You can specify the purge timetable in the Adminster tab of the Admin page (under Global Settings). If you just key on just 1 log table, you're logs may someday go blank.
    The actions used are 'login' and 'logout'. You can link the actions using the key_1 and key_2 columns of the view. From our current experience, Portal does not account for users that simply close the browser. In other words, we have not been able to get a log event for the action 'logout' for the same key_2 value if someone does this.

  • How to get the Role of the logged in User?

    Hi All,
    Enclosed below is the code am trying to use to get the role for a logged in portal user. But it fails
    1. Due to class path errors although I have imported the necessary jar files.
    2. Am unable to invoke/find getSAPUser() method or invoke the UMFactory.
    Iterator rit = null;
    IWDClientUser clientUser = WDClientUser.getCurrentUser();
    IUser user = clientUser.getSAPUser();
    rit = user.getRoles(true);
    IRoleFactory rfact = UMFactory.getRoleFactory();
    while (rit.hasNext()) {
    String roleName = (String) rit.next();
    IRole role = rfact.getRole(roleName);
    wdContext.currentContextElement().setRole(role);
    What could be the problem and what are the jars that need to imported as I am using EP7.0
    Thanks for all your help in advance.
    Best regards,
    Divya

    Hi Divya,
    Add WD_RUNTIME/com.sap.security/lib/com.sap.security.api.jar to your project`s java build path.
    Best regards, Maksim Rashchynski.

  • Get pictogram of PCD roles/workset/iviews from INavigationNode object

    Hi,
    I am trying to develop a sitemap wherein I would like to display the pictogram of the object. The information I have is just the INavigationNode object (from which the UR/short URL/Launch URL can be retrieved)
            String pictogramURLstr,pictogramLink;
         NavigationNodes rootNodes = getrootnodes();
         for(Iterator it = rootNodes.iterator(); it.hasNext();)
              INavigationNode rootNode = (INavigationNode)it.next();
              String title =  rootNode.getTitle(request.getLocale());
              Tree tree = new Tree(title, "");
              tree.setRootNodeIsVisible(true);
              GridLayoutCell cell = new GridLayoutCell(rootNode.getName());
                    pictogramURLstr="<img src=\""+pictogramLink+"\" style=\"BORDER:NONE; VALIGN:MIDDLE; PADDING-LEFT:3px;\"></img>";
              String text = pictogramURLstr+ "<a href=\"" + "/irj/portal?NavigationTarget=" + rootNode.getName() + "\" target=\"_blank\"; style=\"FONT-WEIGHT: normal; FONT-SIZE: 1.25em; CURSOR: hand; COLOR: #FFF; WHITE-SPACE: nowrap; TEXT-ALIGN: center; TEXT-DECORATION:none; \" >"  +title + "</a>";
                    TreeNode root = new TreeNode(rootNode.getName(), text);

    Hi Mahesh,
    I already tried that, but I need the image set in the pictogram property of the role/workset/iView and not the image corresponding to the object type. The ultimate aim would be to get the same result as in using Navigation tag library <nav:navNodePictogram>
    But due to some constraint, I cannot use Navigation tag libraries and want to have the same effect using the INavigationNode object.

  • Getting the Role Title

    Hi All,
    I developed one WD application which browses all the Roles in EP. I am using the code given by Prakash Singh in his weblog on Browsing through Roles,Worksets,Pages and Iviews. In his weblog /people/prakash.singh4/blog/2005/07/28/browse-roles-folders-pages-iviews-assigned-to-a-user-ep6-sp9-and-higher he was not mentioned how to get the Role Title, but he had given the code to get description and Display name of a Role using role.getDescription()and role.getDisplayName().
    Is there any method to get the Title of a Role in the EP.? If yes, Could you please respond to this thread.
    Thank you in advance,
    Sandeep Kumar B

    Hi Denish,
    "Title of Role" is name of a role displayed in the browser.
    I am using the following code to get the name of a role
    try{
    IPcdContext targetObject = (IPcdContext)initialContext.lookup(browsing_root);
    Object object = (Object)targetObject.getAttributes("").get("com.sap.portal.pcm.Title");
    if(object instanceof IPcdAttribute){
         IPcdAttribute att = (IPcdAttribute)object;
         objtitle = att.get().toString();                    
    } catch (NamingException e) {
              msgMgr.reportSuccess(e.toString());
              e.printStackTrace();
    It is throwing ClassCastException at the first line.
    How can I get over this classcastexception.
    Thank you,
    Sandeep Kumar b

  • From which table we can get the Role of the User in SRM

    Hi  All,
        I need to prepare a report which displays the user and his role in srm. So from which table i can get  the role of the user if i have the Userid.
    Thanks
    Channappa Sajjanar

    Hi
    t- code
    SUIM->rOLES->BY USER ASSIGNMENT
    SELECT WITHASSIGNMENT OF USER = username
    AS A OUTPUT YOU MAY GET ROLE ASSIGNED TO THAT USER.
    if you want which FM - you debug while executing this report.
    regards
    Muthu

  • You can get Roles but can you get the Role of the user

    Can you display or hide items dependant on the roles of the logged in user is assigned too.
    I know you can do this for the menu using menu.json
    "visible": true,
            "applyIf": {
                "userHasRoles": ["Administrators"]
    But what about for other elements inside the app. Is there a way to get the roles of the user logged in.
    Is this missing as a feature or am I missing some pieces.

    I just want to hide or remove a page element ie if(adminUserRole != 'Admin') {$('#element').remove}. Just some way to see the roles of the admin user that is logged. But yes early days.
    On a side note BC are looking to launch the project and advertise the store on the 17th is this not a bit ahead of themselves if there is a potential that apps functionality may be reduced because of new policies, restrictions etc even if only temporarily. Once apps hit the masses this may cause some tension when people loose functions they once had.
    Edit :Ok BC have already changed the date of the launch. I jumped the gun in saying this as they have it all under control.

  • Unable to open  the "role"  workset in User Administration

    Hi,
      I have installed Enterprise Portal 6.0 SP9 on Web AS 6.40. But when I goto the "role" workset of User Administration I get "page cannot be displayed".
    So help required.
    Regards.

    Hi Pavanmeet,
    I got the same problem. Try to upgrade to SP17
    and it's solved. Otherwise you can use Firefox for this special site. No good solution - I must admit - but it's displayable with Firefox.
    regards

  • Get the role of a user in portal 6.0

    Hello,
    I need to get the role of a user in portal 6.0. I want to do this in one of the templates to dynamiclly size our tabs due to the fact some roles have more tabs then others.
    travis

    You have to use the Identity Server SDK's to do this ..
    create SSOToken and AMStore Connection object. Using that you can get the AMUser object and do getRolesDNs to the roles the user is assigned to or from AMStoreConnection you can do a getTopLevelContainers to get the orgs, roles etc assigned for the signed in user ..
    take a look at the identity server samples it should be in
    /install_dir/SUNWam/samples/sdk
    HTH ..

  • How do get the role from ldap session.

    i am using the follwing getting the role from the request in openldap and j_security_check:
    f(request.isUserInRole("manager")){
    how can i use this in the session:

    You might wanna change permissions for that attribute ...
    Change it from Admin to OWNER and you should be able to then get it for any user ...
    HTH ..

  • How to get the Role from a process

    Hi,
    I have a process where I have different role panes with human intervention activities. Each human intervention invokes a screenflow.
    Is there any method by which I can get the role pane from which an intance is generated
    For e.g. in process P1, I have 3 different role panes i.e. R1, R2, R3. Suppose there is an human intervention activity A3 in R3. It invokes a screenflow in which there are different methods. I want to get the roleId here i.e. R3.
    Through creation data I can know the instance creator i.e. participant ID, but a participant can have more than one role. I want to get the role from which the Human Intervention activity is invoked.
    Please suggest / help.
    Thanks
    Jayant

    Hey Thanks a tonn
    It works fine by the following code
    role = Activity.role
    logMessage "message"
    logMessage "Role: " + role.name
    role.id returns an int, so I used role.name
    Thanks and Regards
    Jayant

  • How to get the role name in which query is published ?

    Hi Experts,
       Is there any table where i can get the name of the role in which a particular query is published. I know that if i have a role , i can check in pfcg giving that role name and in menu tab i can see all the queries published under that role. But if i know query but not role how to get the role name . Is there any table or functon modules or programs to get the information.
    Thanks & Regards
    Vamsi Kiran

    Check this table
    AGR_HIER

  • I have just installed CS6 Master collection but indesign isn't working, when opening I get the message "Cannot load Assignment UI.InDesign because it requires Username. Please install the Username plugin and restart InDesign." not sure what to do next?

    I have successfully installed the CS6 master collection and all the programs seem to be working apart from InDesign. When opening it I get the message "Cannot load Assignment UI.InDesign because it requires Username. Please install the Username plugin and restart InDesign.". I have no idea what to do next?

    Many people use a font manager to organize a large collection of fonts, and sometimes these cause problems in ID. You might not realize that the font manager has installed a plugin in ID, but I think you would know if you added any other program extensions to help you work.
    Can you show us a new crash report since the 8.0.2 update?
    What happens if you start the Mac with the Shift key held down to prevent extensions from loading? What happens if you go to the System settings and create a new user, then restart the Mac and log in with the new user?

  • How to get the list of values for a dynamic parameter using Web Services SDK?

    <p>I am struggling to get the list of values for a dynamic parameter of a report.</p><p>I am using Java Web Services SDK ... I tried to use PromptInfo.getLOV().getValues() method but it does not work.</p><p>First of all ... is this possible (to get the list of values for a dynamic param) using Web Services?</p><p>Second of all, if this is possible, how should I do it ... it seems it works fine when running the report from CMC. It asks for DB logon info and after that it provides a list of values.</p><p>Thx </p>

    <p>Your assumption is correct. We are trying to get the LOVs from the Crystal Report. I was not aware that this is not supported by Web Services SDK.</p><p>We used Web Services SDK to integrated the Crystal Reports in our web application. We implemented some basic actions for reports: schedule, view instances, run ad-hoc reports.</p><p>We encountered this problem when trying to run/schedule reports with dynamic parameters (a list of values from DB). We were unable to get the LOVs.</p><p>Please let me know if you can think of an alternative to look at.</p><p>Thanks a lot,</p><p>Catalin </p>

  • I have an Apple ID and trying to sign in for the 1st time on iTunes. When I do, I get the message: "This Apple ID has not been used with the iTunes Store. Please review your account information." When I do, I get stuck in the same loop and can't sign in!

    I have an Apple ID and trying to sign in for the 1st time on iTunes. When I do, I get the message: "This Apple ID has not been used with the iTunes Store. Please review your account information." When I do, it brings me to the same AppleID login window, and I get stuck in the same loop. I never get to the following screen to enter my account info. What's going on?? This is MADDENING!

    If you want to use it, click Review and check your account information.  Or you could contact the store support staff if you are concerned at http://www.apple.com/emea/support/itunes/contact.html for further help.

Maybe you are looking for

  • Why do I get "Connection failed" when trying to connect to Lion?

    One of our two Macs is running Snow Leopard, the other, Lion. I can connect from Lion to Snow Leopard OK, but not the other direction: when I try, I get "Connection Failed." I can connect as guest however. Ive run Disk Warrior on both machines. No ch

  • System file deletion to boot in Lion?

    What I would like to know is what system file can I delete from the system when booted from another partition so I can boot up in Lion. Lion locked up when I had ten applications open with a multiple windows and I had to do a HARD SHUT DOWN. Now ever

  • Typing is slow in some Windows 8.1 apps

    I upgraded the HDD in my ultrabook - replaced it with a modern SSD, and then deployed a fresh copy of Windows 8.1 from the recovery image. However, after that I see a strange behavior in some programs, for instance Internet Explorer and MS Word. When

  • Oracle sql developer work sheet

    Hi I am working on a project which has large sql statements, I want maximise the space in editor to view as much sql as I can see. Now in sql work sheet we have buttons at top, like run statement, run script, auto trace etc. how can I move these butt

  • Registration code not sent for Crystal Reports Basic for VS2008

    I need to know how to receive a CR registration code for VS2008. In VS2008 when I open a Crystal Report, I'm asked for a registration code.  So I registered at the SAP website for the CR Basic for VS2008 license, but all I received was an email below