Getting users for a role in EJB

Hi
How do I get the list of users associated with a particular role
Ex: There is a requirement where I need to get all the users belonging to the
admin role in a Sessionbean.
How do I do this?

"madhav" <[email protected]> wrote in message
news:[email protected]..
>
Hi
How do I get the list of users associated with a particular role
Ex: There is a requirement where I need to get all the users belonging tothe
admin role in a Sessionbean.
How are you defining the role? Does it correspond to a group or are you
using an expression?
For the default role mapper provider, it may be difficult as it evaluates
role membership based on expressions
and does not have a fixed set of role members.

Similar Messages

  • Assigned users for a role

    Hi
    I am looking for auditing feature in Portal. I created a portal role,say ABC in portal and added an iView to that role. When ever I create any user, I am assigning this role to that user. Now I want to know the users associated to this role ABC. Under User Administration tab, when I look at Assigned Users for this role, I don't see any users. But when I see the roles assigned to any user, I can see this role assigned to this user. I don't want to go to all users and check whether this role is assigned or not.
    Also, I want to know the users who all are accessing the iview in role ABC currently. Can you please help me with these points.
    Thanks in advance
    Tejo

    Hi Tejo,
    check below thread
    Read all the users assigned to a portal role
    Koti Reddy

  • Assign User for Process Role Callable Object

    Hi,
         I have a doubt in the Callable Object Assign User for Process Role.wat is the use of this callable object.This Callable Object is used to reterive any portal user information?can any one give description about this Callable Object.
    Regards,
    Satheshkumar

    Hi,
    Take a look at the following [wiki page |https://wiki.sdn.sap.com/wiki/display/BPX/GuidedProceduresCallable+Objects] and look for the callable object you need. There is a link to a tutorial.
    Dick

  • Getting UWL task count for all users in a role.

    Hi.
    I recently posted a question regarding a very similar issue, but I haven't got any response yet. I think my question might have been somewhat poorly phrased, so I will try to do better at explaining what we need.
    We have a number of processes, most of which need to be dynamically assigned to a user when created. The way we want to assign those tasks is by executing a WebService which would receive a role name and get all the users for that role. Then, using the UWL API, it would check how many tasks each of the users have in their UWL, and return the UserID for whoever has the least tasks. I haven't been able to get this to work. I keep getting Logged in users context or session doesn't exist Exception.
    Please, any help on this will be greatly appreciated.
    Currently working with SAP NWDS 7.1 SP05 PAT0005

    Hi,
    Thank you for your response, however, that's not what I need.
    For you and anyone esle who might find this extra info useful...
    I know how to get a user's role(s), and how to get the users in a role.
    I also know how to assign a task to a specific user dynamically.
    Using the UWL API, I know how to get the tasks (or items) in a user's UWL from a WD application, I need to do that from a WebService and using pretty much the same code, with the necessary adjustments, I can't get it to work.
    Furthermore, I'm able to get the UWL tasks for ONE user, that user being the one I log into the application with. For example, if I write code to get the tasks for user testUser1, I need to log in with testUser1 to get it to work, if I log in with any different user or make it a non-authenticated application, it won't work.
    Again, help on this is much needed and will be appreciated.

  • How do I get a list of users for a specific role in EP 6.0

    Hi,
    I'm trying to find a table or an API that I can use to get a list of users for a role that I have created in the portal. There are about 940 users tied to this role that I would like to dump to an excel or text file. My goal is to get these users into a security group and tie the role to the group instead of each user. Thanks!

    Hi Chris,
    first, welcome on SDN!
    UMFactory.getInstance().getRoleFactory(roleID).getUserMembers() returns the users which are members of the role, see http://media.sdn.sap.com/html/submitted_docs/60_sp2_javadocs/ume/com/sap/security/api/IRole.html
    addGroupMember(...) adds a group.
    removeUserMember(...) removes a user from a role.
    Corresponding method exist for the groups.
    Hope it helps
    Detlev
    PS: Please consider rewarding points for helpful answers on SDN. Thanks in advance!
    PPS: Wrong forum, should have been EP DEV for example. It's not a question in conjunction with KM.

  • Get child users of composite role

    Hello
    There is FM (ESS_USERS_OF_ROLE_GET ) which bring all user of roles but what i want it's more complicated
    IF there is composite role i want to get all the user that in the roles under the composite role .
    Let say i have composite role with two roles inside (in the role tree ) .
    Composite role
    user1"this is the users of the composite role
    user2
    user3
    Role number  1
    user4
    user7
    user9
    Role number 2
    user 8
    user 5
    user7
    user6
    What i want is to get all the users of the composite role  and the child  role (which is parent ) .
    which is .
    users 1 - 9.
    I read some previous post on this issue in the forum but what I need is to use just this FM without access  to the DB
    table such as T_AGR_AGRS and COLL_ACTGROUPS_GET_ACTGROUPS ,
    What i need to do is recursive call on  the FM ESS_USERS_OF_ROLE_GET  .
    Regards
    Joy
    Edited by: Joy Stpr on Aug 23, 2009 8:50 AM

    Hello Joy,
    How is it possible to use just function module ESS_USERS_OF_ROLE_GET to get data without DB access?
    I mean this function module takes input as Simple/Composite ROLE so you have to have some list maintained
    which will be input for this function module.
    I think you can load composite and simple role in table and loop at it to make calls to function module ESS_USERS_OF_ROLE_GET to get users for compsite/simple roles.
    Some input has to be there, That's what I feel.
    Check if this helps!
    Thanks,
    Augustin.

  • C4C Advanced Users for Marketing?

    Hello,
    I am finding it difficult to get information on the Marketing changes going on within the solution.  I understand that the major move was to the Hybris Marketing Bag, but what does that mean for the marketing functionality within Cloud for Customer?
    I have a customer who wants to add 5 Marketing Users, which is probably too small for the Hybris solution.  So what Enhanced Marketing Functionality do these users get as part of the Advanced User for Marketing role?
    The customer wants to be live with these users by end of the month, so timing is critical.
    Thank you for your guidance
    Neil Roosevelt
    YASH Technologies

    Dear Neil,
    Please work with your organizations dedicated partner contact from SAP to be able to get the right set of details relevant to this matter.
    Thank you.

  • BDC recording for SU01 - Roles

    Hi All ,
    I am using BDC recoording of the SU01 T code for the modification of the end date of the assigned roles .
    In few scenario there are few cases where user does have direct and indirect roles . I am able to change the end date of the direct roles via BDC in SU01 but since indirect roles which are depedent on direct roles and therefore the end date fields is not editable and hence on the warning my BDC is unable to update anything in SU01 .
    Can any one advise , how can i proceed with BDC recording to capture editable and noneditable fields ?

    Hi,
    it's not possible with BDC recording to know if a field is in input mode or only in output mode.
    PS : Search if you cannot used a BAPI. f.e BAPI_USER_*
    REM : Just one remark if you use time assignment
    Time-dependency of user assignment and authorizations                                                                               
    o   If you are also using the role to generate authorization profiles,  
        then you should note that the generated profile is not entered in   
        the user master record until the user master records have been      
        compared. When you specify the users for the role, the system enters
        by default the current date as the start date of the user           
        assignment, and 12.31.9999 as the end date. If you want to restrict 
        the start and end dates of the assignment, for example, if you want 
        to define a temporary substitute for a user, the system             
        automatically makes the changes to the user. This automatic         
        adjustment of the user's authorizations is executed using report    
        PFCG_TIME_DEPENDENCY. In this case, you should schedule report      
        PFCG_TIME_DEPENDENCY daily, for example, early in the morning, to   
        run in the background (in transaction SA38, for example). This      
        compares the user master records for all roles and updates the      
        authorizations for the user master records. The system removes      
        authorization profiles for invalid user assignments from the user   
        master record, and enters authorization profiles from valid user    
        assignments to a role.                                              

  • ;-| Is it possible to get a list of Roles for the EJB Caller?

    Hi,
    from an EJB I can use isCallerInRole(role), however I would like to get a
    list of Roles that the user is in to do DB lookups for each role...
    I have an implementation under 'JBoss' which does a JNDI lookup for the
    SubjectSecurityManager using java:/jaas/other and then uses that to get at
    the roles...
    Is there a 'standard' way of doing this?
    Is there a 'SubjectSecurityManager' like beast on WebLogic?
    Any help would be greatly appreciated!
    Kind regards
    Lewis

    Hi Lewis,
    I believe there is not a method for this currently but I believe it has been suggested
    to our security team. Watch for this feature in a future release.
    It maybe possible to write a method for this if you are using a custom realm.
    Kind Regards,
    Richard Wallace
    Senior Develoepr Relations Engineer
    BEA Support.
    "Lewis Henderson" <[email protected]> wrote:
    Hi,
    from an EJB I can use isCallerInRole(role), however I would like to get
    a
    list of Roles that the user is in to do DB lookups for each role...
    I have an implementation under 'JBoss' which does a JNDI lookup for the
    SubjectSecurityManager using java:/jaas/other and then uses that to get
    at
    the roles...
    Is there a 'standard' way of doing this?
    Is there a 'SubjectSecurityManager' like beast on WebLogic?
    Any help would be greatly appreciated!
    Kind regards
    Lewis

  • Getting tasks for all users in a role

    Hi,
    We need to get all users in a Role, and out of those, find out which one has the least tasks in their UWL using a WebService. Saw some example codes and here's my attempt at it. Doesn't quite work, I'm getting the Logged in users context or session doesn't exist Exception. Any help on this will be GREATLY appreciated.
    public class LeastTasksBean implements LeastTasksLocal {
         public String getUserLeastTasks( String sRole )
              try{
                   Map<String, String> users = new HashMap<String, String>();
                   Map<String, String> tasks = new HashMap<String, String>();
                   final int sessionIdleTimeout = 60;
                   String Users[] = UMFactory.getRoleFactory().getUsersOfRole( sRole, true );
                   if( Users != null ){
                        for( int i = 0; i < Users.length; i ++ ){
                             UWLContext  uwlContext      = new UWLContext();
                             IUWLService uwlService      = findService();
                             uwlContext.setAllowBackEndConnections( true );
                             IUser uwlContextUser        = UMFactory.getUserFactory().getUser( Users[0] );
                             uwlContext.setUser            ( uwlContextUser );
                             Locale loc                  = new Locale( "ES" );
                             uwlContext.setLocale          ( loc );
                             HttpServletRequest request  = getHttpRequest();
                             uwlContext.setOriginRequest   ( request );
                             IUWLSession session         = uwlService.beginSession( uwlContext, sessionIdleTimeout );
                             uwlContext.setSession         ( session );
                             IUWLItemManager itemManager = uwlService.getItemManager( uwlContext );
                             QueryResult result          = itemManager.getItems( uwlContext, null, null );
                             users.put( String.valueOf( i ), uwlContext.getUserName() );
                             tasks.put( String.valueOf( i ), String.valueOf( result.getItems().size() ) );
                             uwlService.endSession( uwlContext );
                        int userTasks = 0;
                        int leastTasks = Integer.valueOf( tasks.get( 0 ) );
                        int userKey = 0;
                        for( int i = 0; i < Users.length; i ++ ){
                             userTasks = Integer.valueOf( tasks.get( Integer.toString( i ) ) );
                             if( userTasks < leastTasks ){
                                  leastTasks = userTasks;
                                  userKey = i;
                        return users.get( Integer.toString( userKey ) );
                   else{
                        return "No users exist for this role";
              //Exception Handling
         private IUWLService findService() throws NamingException
              Properties properties = new Properties();
              properties.put( InitialContext.INITIAL_CONTEXT_FACTORY, "com.sapportals.portal.prt.registry.PortalRegistryFactory" ); 
              InitialContext ctx = new InitialContext( propiedades ); 
              IUWLService uwlService = ( IUWLService ) ctx.lookup( IUWLService.ALIAS_KEY );
              return uwlService;
         private HttpServletRequest getHttpRequest() throws Exception
              Properties properties = new Properties();
              properties.put( "domain", "true" );
              ApplicationWebServiceContext wsContext =
                   (ApplicationWebServiceContext) new InitialContext( propiedades ).lookup( "/wsContext/" + ApplicationWebServiceContext.APPLICATION_WSCONTEXT );
              HttpServletRequest request = wsContext.getHttpServletRequest();
              return request; 

    Hi David,
    I have a similar requirement on our project. I need to get a count of pending workitems for all user but I'm getting similar message when I try to access UWL context of any other user.
    Did you find any solution for this? Is it possible to get the workitems for all users using webservice or wendynpro?
    I would appreciate if you can provide some inputs on this.
    Thank you in advance.
    Regards,
    Seema Rane

  • How to restrict login for multiple users having same Role

    Our Web Application is deployed on Tomcat 5.5
    The requirement is ?
    There are roles in application like "operator", "admin"?
    There are multiple users created for each of the above role.
    When one user of "operator" role is logged in, then
    It should not allow to login for another user of "operator" role.
    Also, if user did not log out & application gets close, then
    It should not allow to login for another user of "operator" role.
    Also, it should not allow to login for multiple requests of same user
    (using another browser instance...)
    Is it possible using session object?
    But, using session object, it will create separate objects for different users,
    So here I will not be able to restrict session object creation rolewise.
    Also, how to retrieve these multiple session objects created for different users on server?
    If anyone is having the solution please reply as soon as possible,
    Thank you.

    To tell you the truth, this is a stupid requirement. It must be an extremely fragile application.
    In any case, you will have to write your stuff for that. Probably a filter that on login, logout, and session expiration checks, makes, or removes entries in a DB (using a synchronized resource to prevent race conditions) or possibly even simply in an application context object.

  • SECATT for assigning roles to users

    Hi All,
    How do we make the ECATT to work for the below scenario:
    Users already have roles assigned to them. We need to add a new roles to the users which can vary in number based on the users job.
    A simple ECATT script that was developed to add a single role to a new user does not work in the above case and gives an error of invalid batch input. How do I create a ECATT to assign role to user who already has a set of roles assigned (number of roles assigned to users differ, so I cannot assume to train the ECATT to assign a role on line X). Is there something I am missing while the ECATT script creation?
    We are doing this from a CUA and its very difficult to assume how many roles a user could have.
    Thanks,
    Jay

    Thanks Alex for the insight. For some reason SU10 is slow in the CUA environment and I wanted to avoid it but yes I finally had to use SU10. Talking to one of our ABAPer I came to know that even in their BDC recordings they get the error which I receeived, but he changes his program to skip all the lines with data and then fill the empty line.
    In CUA environment, how do we create ECATT to delete a role from many users?
    Thanks,
    Jay

  • How to get the list of roles assigned to a user in all the child systems

    how to get the list of roles assigned to a user in all the child systems from CUA SYSTEM

    Try transaction SUIM in your CUA system. Go to user, cross-system information, users by roles. If you run it wide open, you'll get all users and all roles assigned for all systems managed in your CUA.
    Krysta

  • One CUP request for assigning role to multiple users

    Hi,
    We assign roles to users in production only through CUP requests.. We use GRC 5.3
    Here we have a case where we need to assign one role to  60 users in production(each user may have different  roles assigned in the back end) . I can raise one CUP request for all users using " multi-user" option in Copy request . But when we want to make a risk analysis , it will not show risks at user level as each user had different roles and may get different risks by adding new role.
    Instead it will give risks if any for only that new role which want to assign. Our manager is not accepting as this is not giving complete picture of risks for each user when we add new role.
    Please suggest me if there is any other way where I can make a risk analysis for each user when I created a CUP request for multiple users.
    Or the only solution is to create 60 CUP requests ?? this would be too manual
    Regards ,
    jaags

    Raghu,
    thanks for the reply, you are right as per the audit .But suppose if it is for 200 users ,creating 200 CUP requests will be impractical right.
    there should be some solution for this , because there will be many situations practically where we have to assign roles to N number of users.
    Is this possible in GRC 10 ? any idea ?
    Regards,
    Jaags

  • How to get the user list under role

    Hi Gurus,
    in mdm console, if you select a role, you will see the users who are assigned to this role.
    how can I get this user list through java api.
    Ouser server is  MDM7.1SP5
    Best regards,
    John

    Hello John
    you cann't get users list.
    you can get user roles information since SAP MDM 7.1 SP3:
    com.sap.mdm.security.commands GetUserRoles Command
    A command to retrieve the array of roles for the specified user
    more about api  you can read here(What's New in MDM Java and .NET API - part):
    http://help.sap.com/saphelp_nwmdm71/helpdata/en/13/041975d8ce4d4287d5205816ea955a/frameset.htm
    Regards
    Kanstantsin Chernichenka
    Edited by: Kanstantsin Chernichenka on Mar 11, 2011 3:10 PM

Maybe you are looking for

  • Customized Reports - Graphics / Calendar Style

    Hi, I'm a project scheduler, experienced with P5 & P6. I'm currently using Primavera P6.1. I haven't done much report writing, and I am currently tasked with creating two customized reports. <strong>GRAPHICS ON REPORTS?</strong> One of the reports is

  • Goodbye to my old iMac

    I am finally going to purchase a new intel iMac and will be getting rid of my old iMac (15 inch CRT display circa 1999, G3 / 333 MHz processor and 192 MB RAM with OS 9.2.2). I will probably donate it to a nearby school. I need to know how to totally

  • Rc3.d scripts dont echo messages on console in solaris 10

    how can I make the rc3.d scripts messages echo on console? Problem : I have a script that is started in the /etc/rc3.d directory. I have verified that they work under Solaris 10. It sends these messages to some logfile and then exits. How would I get

  • Customer fiscal year in scheduling agreement

    hi SD experts,   i meet a problem as below,   Cumulative issued quantity in SA can not cumulate the previous year's quantity, i have checked the delivery schedule header data and find that Customer fiscal year and customer previouse year (Customer fi

  • Why does my speaker output balance keep changing?

    Hi, I've noticed that every now and again, the output balance for the speakers on my MacBook Pro (13-inch, retina display, early 2013) keeps changing randomly and shifting to the left channel. This is really frustrating since never change it manually