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 ..

Similar Messages

  • 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);

  • Function module to get the roles assigned to user

    Hi to all experts,
    I need a fm to retrieve the roles assigned to user .
    if a pass sy-uname as importing parameter i should to get all the roles assigned to that particular user

    hai,
    please try this.
    /VIRSA/RE_BAPI_CREATE_ROLE- Create Roles
    /VIRSA/ROLE_ASSIGN_CUA_NH
    /VIRSA/RE_BAPI_ROLE_TO_USERS
    ASSIGN_USERS_HIERARCHY - User Assignment to Role - this is a Normal FM
    try this bapis this may work
    BAPI_USER_LOCK
    - BAPI_USER_PROFILES_ASSIGN
    - BAPI_USER_LOCPROFILES_ASSIGN
    - BAPI_USER_LOCACTGROUPS_ASSIGN
    - BAPI_USER_CHANGE
    - BAPI_USER_UNLOCK

  • 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.

  • 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

  • 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

  • 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 can i get the list of all users present in the LDAP

    Hi Experts,
    How can i get the list of all users present in the LDAP ?
    Is there any API or function Code to get all user list??
    Please help me out!!!
    Help will be rewarded

    Well it will depend on exactly where your UME configuration points to in the LDAP tree but yes, it is possible to get all users.  Something like the following should do it:
    import com.sap.security.api.*;
    import com.sapportals.portal.prt.component.*;
    IUserFactory iuf;
    ISearchResult isr;
    IUser user
    String userid;
    iuf = UMFactory.getUserFactory();
    isr = iuf.getUniqueIDs();
    you will need to iterate the ISearchResult object but you can get IUser objects by
    userid = (String)isr.next();
    user = iuf.getUser(userid);
    then you can imanipulate / identify / or whatever you need with the user object
    Haydn

  • How to get the activity of a user?

    Hi Experts,
    How can we get the activity of a user i.e. Which transaction a particular user has gone or some activity log on a particular date? Any table, FM or Tcode. I have already checked the STAD and SM20 transactions. Some authorization problem. So anything except these Tcodes would be helpful. Thanks in advance.
    Regards,
    Prashant.

    >
    santhosh kumar wrote:
    > Hi,
    >
    > I guess if it is not updated or traced under STAD means, i.e. related to authorization failures etc.. kind of stuff will be saved at runtime only in the SAP memory.
    >
    > As it is stored in the buffer, can not be traced in any of the transaction.
    > You should request the user to save and send the screen shot of the SU53 of the user whenever he gets some authorization issue.
    >
    > Based on that, by looking into the SUIM transaction, it can be known whether he is authorized or not, which roles have been assigned etc.. kind of details.
    >
    > Regards,
    > Santhosh.
    Hi Santosh,
    Actually I am doing a root cause analysis for which I need to know whether a particular user has used a particular TCode. I guess the STAD will display only the current data, is there a TCode to display historical data related to user accessing a particular data. Note: I don't have basis authorization.
    Regards,
    Prashant

  • 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 list of IDM users in a workflow.

    Hi,
    I wanted to get the list of IDM users in a workflow into a list.Now I tried to use getObjects Method,I do not have the display session here,I passed the workflow context or WF_Context.But it is giving exception like context null .
    I used the same method in a form and it worked.How can I get the list of users in a workflow.It is for customizing reports.
    Thanks and Regards,
    Pandu
    Any Idea on how to customize reports including attributes from resources and auditing attributes etc.Any help would be really great.
    Thank you.

    Hi John,
    I get this exception WorkItemForm: no id.
    This comes when I click on the other column.I generate the data needed in a report and display it as a sorting table when I get the data.
    I want to give the user ability to sort data by different columns.But when I click any column I get the exception
    WorkItemForm: no id
    How can I save a workitem on a manual form before invoking it from a manual action.
    Here is the code snippet
    <Field name='tblUsers'>
            <Display class='SortingTable'>
              <Property name='selectEnable' value='false'/>
              <Property name='align' value='left'/>
              <Property name='linkEnable' value='false'/>
              <Property name='sortEnable' value='true'/>
              <Property name='width' value='400'/>
              <Property name='columns'>
                <List>
                  <String>Account id</String>
                  <String>First Name</String>                      
                </List>
              </Property>
            </Display>      
            <FieldLoop for='row' in='_searchList[*]'>
              <Field name='enduserId'>
                <Display class='Label'>
                  <Property name='value'>
                    <block trace='true'>
                      <invoke name='getAccountId'>
                        <ref>row</ref>
                      </invoke>
                    </block>
                  </Property>
                </Display>
              </Field>
              <Field name='lblfirstname'>
                <Display class='Label'>
                  <Property name='value'>
                    <invoke name='getAttribute'>
                      <ref>row</ref>
                      <s>firstname</s>
                    </invoke>
                  </Property>
                </Display>
              </Field>
         <FieldLoop>      I think I may need to save some workItem,That is why this may be giving the error.How can I correct this.
    Thanks,
    pandu

  • How to get the list of actie users in the moss website !!

    Hello Everybody,
    I need to get the list of active users with access in the moss websites like following format.
    User name         User mailid       permission
    one of the project manager requested to find list of active users with user accesses in the moss website.
    he wants to modify the user permissions.
    Kindly suggest me how to get the users with permissions.
    Thanks.

    Hi,
    I have developed that code to retrieve the users, groups and permissions
    if (orole.Member.PrincipalType.ToString() == "SharePointGroup")
    lvigroup = new ListViewItem();
    lvigroup.Text = orole.Member.LoginName;
    // args.GroupsList.Items.Add(lvigroup);
    DoUpdate1(lvigroup);
    Group group = clientContext.Web.SiteGroups.GetById(orole.Member.Id);
    UserCollection collUser = group.Users;
    clientContext.Load(collUser);
    clientContext.ExecuteQuery();
    foreach (User oUser in collUser)
    lvigroup = new ListViewItem();
    lvigroup.Text = "";
    lvsigroup = new ListViewItem.ListViewSubItem();
    lvsigroup.Text = oUser.LoginName;
    lvigroup.SubItems.Add(lvsigroup);
    //args.GroupsList.Items.Add(lvigroup);
    DoUpdate1(lvigroup);
    // MessageBox.Show(oUser.LoginName);
    RoleDefinitionBindingCollection roleDefsbindings = null;
    roleDefsbindings = orole.RoleDefinitionBindings;
    clientContext.Load(roleDefsbindings);
    clientContext.ExecuteQuery();
    //permission level
    lvsi = new ListViewItem.ListViewSubItem();
    string permissionsstr = string.Empty;
    for (int i = 0; i < roleDefsbindings.Count; i++)
    if (i == roleDefsbindings.Count - 1)
    permissionsstr = permissionsstr += roleDefsbindings[i].Name;
    else
    permissionsstr = permissionsstr += roleDefsbindings[i].Name + ", ";
    Kind Regards, John Naguib Technical Consultant/Architect MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation

  • How can i get the list of all users present in the UME ?

    Hi Experts,
    How can i get the list of all users present in the UME ?
    Is there any API or function Code to get all user list??
    Please help me out!!!
    Help will be rewarded
    -pankaj chouhan

    Hi Pankaj,
    find the official NetWeaver security javadocs (including access to UME) <a href="http://help.sap.com/javadocs/NW04S/current/se/index.html">here</a>. Look for classs UMFactory and proceed from there.
    Best regards,
    Martin

Maybe you are looking for