Determine Users in a Role

Hello,
From SQLPlus how can you determine what users are in a Role?
Thanks,
Michael

What do you think that the OS group information be stored in the database?
Or, are you looking for a way to query the Windows OS from within Oracle to get information of the users assigned to a particular NT Group?

Similar Messages

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

  • Checking if a user has a role (FGAC)

    Hi!
    I am implementing Fine Grained Access Control on a table and in my policy function I do not want to restrict the amount of result data on a select if the current user has a certain role (otherwise I want to).
    My idea was to check USER_ROLE_PRIVS/ROLE_ROLE_PRIVS for the role, but the stored procedure runs with definer-rights, so that won't help.
    Running the procedure with invoker-rights won't help either, since not the current user is the invoker of the policy function but the DB system (user sys?).
    And finally, the definer of the policy function does not have DBA privs, so I can't select the DBA_* views to check if the current user has the role.
    Is there another way to check if the current user that is known inside the policy function by the USER variable has a certain role?
    Thanks for your help!
    Marcus

    Hi Frank,
    thanks for your answer!
    Frank Kulash wrote:
    Policy functions are run by the user who queries or tries to do DML on the table.I don't see that this is happening. Here's my test case:CREATE OR REPLACE FUNCTION CU_is_member_of
    (v_role IN VARCHAR2) RETURN NUMBER
    AUTHID CURRENT_USER
    is
    v_res VARCHAR2(255);
    begin
    SELECT COUNT(*)
    INTO v_res
    FROM
    (SELECT GRANTED_ROLE FROM USER_ROLE_PRIVS
    UNION
    select GRANTED_ROLE from role_role_privs)
    WHERE UPPER(GRANTED_ROLE)=UPPER(v_role);
    RETURN to_number(v_res);
    end;
    CREATE OR REPLACE FUNCTION POLIFUNC_PARTTYPES_WRITE
    (p_schemaname IN varchar2, p_tablename IN varchar2)
    RETURN VARCHAR2
    IS
    BEGIN
    IF USER=p_schemaname
    THEN RETURN '';
    ELSE
    BEGIN
    if SYSWM_TOOL.CU_is_member_of('#ACT#WMT_MANAGE_PARTTYPES')=1
    THEN RETURN ''; -- *****
    ELSE
    BEGIN
    RETURN '1=0';
    END;
    end if;
    end;
    END IF;
    END;
    CALL SYS.DBMS_RLS.ADD_POLICY('SYSWM_TOOL', 'TBL_PARTTYPES', 'POL_PARTTYPES', 'SYSWM_TOOL', 'POLIFUNC_PARTTYPES_WRITE', 'select'); --TODO: SELECT->UPDATE,INSERT,DELETE
    If the policy function is run by the user who queries, then I would expect that a user who has the role querying table TBL_PARTTYPES would see all entries since he would run into the line marked with *****.
    SQL> select SYSWM_TOOL.CU_is_member_of('#ACT#WMT_MANAGE_PARTTYPES') FROM DUAL;
    SYSWM_TOOL.CU_IS_MEMBER_OF('#ACT#WMT_MANAGE_PARTTYPES')
    1
    SQL> SELECT COUNT(*)
    2 FROM
    3 (SELECT GRANTED_ROLE FROM USER_ROLE_PRIVS
    4 UNION
    5 select GRANTED_ROLE from role_role_privs)
    6 WHERE UPPER(GRANTED_ROLE)=UPPER('#ACT#WMT_MANAGE_PARTTYPES');
    COUNT(*)
    1
    So, the current user has the role and the stored function CU_IS_MEMBER_OF works correctly. However:
    SQL> select count(*) from syswm_tool.tbl_parttypes;
    COUNT(*)
    0
    What am I missing here?
    Marcus

  • Error assigning users to application Role in Obiee 11.1.1.7.0

    Hello
    I installed Obiee 11.1.1.7.0 both on Windows and Linux platform and after that, I successfully set Active Directory integration. I have a problem assigning users to Application Role in EM. When I'm trying to search a user on Display name, the Principal userName returned is blank and the error is : Java Null Pointer Exception
    After that I install a fresh copy of 11.1.6.0. After AD Integration, I was able to assign users to Application Role. I made 11.1.1.7.0 upgrade and same error has come. I think this is a bug because same AD settings on 11.1.1.6.0 works.
    The error:
    ava.lang.NullPointerException
    #{viewScope.emas_pagemodel_security_EditAppRole.searchPrincipal}: java.lang.NullPointerException
         Hide Additional Trace Information
    javax.faces.FacesException: #{viewScope.emas_pagemodel_security_EditAppRole.searchPrincipal}: java.lang.NullPointerException at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118) at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190) at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92) at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361) at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96) at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:103) at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92) at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361) at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96) at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:97) at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:1086) at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:434) at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:207) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.emSDK.license.LicenseFilter.doFilter(LicenseFilter.java:101) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:128) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446) at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177) at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.help.web.rich.OHWFilter.doFilter(Unknown Source) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.emas.fwk.MASConnectionFilter.doFilter(MASConnectionFilter.java:41) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:180) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.eml.app.AuditServletFilter.doFilter(AuditServletFilter.java:179) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.eml.app.EMRepLoginFilter.doFilter(EMRepLoginFilter.java:203) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.core.model.targetauth.EMLangPrefFilter.doFilter(EMLangPrefFilter.java:158) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.core.app.perf.PerfFilter.doFilter(PerfFilter.java:141) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.eml.app.ContextInitFilter.doFilter(ContextInitFilter.java:542) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119) at java.security.AccessController.doPrivileged(Native Method) at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:324) at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460) at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103) at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171) at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:163) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209) at weblogic.work.ExecuteThread.run(ExecuteThread.java:178) Caused by: javax.faces.el.EvaluationException: java.lang.NullPointerException at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:51) at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102) ... 67 more Caused by: java.lang.NullPointerException at oracle.sysman.emas.model.security.DialogAdminBean$1.compare(DialogAdminBean.java:567) at java.util.Arrays.mergeSort(Arrays.java:1270) at java.util.Arrays.mergeSort(Arrays.java:1281) at java.util.Arrays.sort(Arrays.java:1210) at java.util.Collections.sort(Collections.java:157) at oracle.sysman.emas.model.security.DialogAdminBean.fetchPrincipals(DialogAdminBean.java:563) at oracle.sysman.emas.pagemodel.security.identity.EditAppRolePageModel.searchPrincipal(EditAppRolePageModel.java:496) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.sun.el.parser.AstValue.invoke(Unknown Source) at com.sun.el.MethodExpressionImpl.invoke(Unknown Source) at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:46) ... 68 more
    Any suggestion?
    Thx
    Gabriel
    Edited by: Gabbriel on Apr 23, 2013 10:46 PM

    We received from Oracle a work-around of this problem.
    It seems to be related to the virtualize flag set to true. I f you set it to false the problem disappear (it works for me).
    (rif. http://docs.oracle.com/cd/E28280_01/bi.1111/e10543/privileges.htm#BABDCJBH)
    There's an open BUG on this problem: Bug 16808088 - 11G JAVA.LANG.NULLPOINTEREXCEPTION ADDING USER TO ROLE AFTER UPGRADE TO 11.1.1.7.
    Hope this works.
    S.

  • 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 to add multiple users to a role in ECC 6.0

    How to add multiple users (say 1000) to a role in ECC 6.0?

    Hi
    You can actually add multiple users to a role using transaction SU01. From SU01, use the menu Environment->Mass Changes.
    Here you can manually add the users, select them by address or authorisation data. Once you have your user list, you can then add or remove roles and/or profiles.
    Secondly , You can use SU10 to do mass changes to multiple users including role assignments per logical systems
    Also check the following link:
    http://www.sap-img.com/bc021.htm
    I hope this should do it
    regards
    Chen

  • How to determine the database mirroring role via Powershell?

    Is there a way to determine the current mirroring role of a database via Powershell without the use of t-sql?
    With the Microsoft.SqlServer.Management.Smo namespace and database class I can determine the status, witness and partner of the mirrored database, but I can't determine the mirroring role of the current database. I basically want to get the same result
    as the following t-sql query in powershell without using t-sql:
    SELECT m.mirroring_role_desc 
    FROM   sys.database_mirroring m JOIN sys.databases d
    ON     m.database_id = d.database_id
    WHERE  d.name = 'databasename'
    I find it very strange that there is no class property to check for this, while it is an important property of the database. Of course I can use the output of this query in my powershell script for further processing, but I still hope that there is a property
    where I can get this information.
    TheSultan8

    Just to let you know, I've already found it. Here is a part of the code that I use for checking each mirrored database what mirroring role it has:
    $sqlconnection="MYLAPTOP\SQL2008R2"
    $smo = New-Object ('Microsoft.SqlServer.Management.Smo.Server') $sqlconnection
    $mirroreddbs=$smo.Databases | where {$_.IsMirroringEnabled -eq "True"}
    $sqlversionmajor=$smo.VersionMajor
    foreach ($database in $mirroreddbs)
    # Versions lower than SQL 2008 can't query a database in recovery mode
    if ($sqlversionmajor -ge 10) 
    $dbrolevalue=$database.DatabaseOptions.Properties | where {$_.Name -eq "MirroringRole"}
    $dbrole=$dbrolevalue.Value
    One catch though, this only works on SQL 2008 and higher version.
    TheSultan8

  • Report to see user type and roles assigned to users in EP?

    Hi,
    a) Is there any reporting mechanism in EP? Any specific report which throws up user types and roles assigned to the users? There is an option of 'Export' in the user management role but unfortunately it does not give information on User Type.
    b) If  the group is assigned a role, How can we see ( in any report) the roles assigned to a group? In the 'export' option of the 'User Management' this information does not come.

    By default Portal UME comes along with the installation of portal.
    Sometimes we may integrate external users using LDAP. At that time users come from ABAP stack or some active directories.  But you can also create users in the portal UME.  The purpose of using LDAP is to maintain the users centrally rather than creating again in portal.
    You can check them in user administration->identity management and search for the users.
    THere you can see some users will be from UME and some from LDAP.
    User Admin tool is nothing but User Administration only.
    Raghu

  • Performance tab not working in Enterprise Manager for user with dba role

    Database: 11g2
    New to Oracle. Don't want share SYS user account among dbas. Tried to create user with dba role to perform all tasks.
    1. Removed DBMS_JOB, DBMS_LOB, UTL_FILE, UTL_HTTP, UTL_SMTP, and UTL_TCP from PUBLIC
    2. Created user dbauser1 with dba role
    3. Log in as dbauser1 in Enterprise Manager
    After click Performance tab, it just went straight to "Database Login" page. No error message.
    Any suggestions or advice will be appreciated.
    piaoma

    Hi Gourav,
    This is the wsdl url:
    http://hostname:8000/sap/bc/srt/wsdl/bndg_E04711310A0E55F1A0E3005056B03D6F/wsdl11/allinone/ws_policy/document?sap-client=450
    Kind Regards,
    Richard

  • Abap+java abap-user and portal-role PROBLEM?? help

    We have the ABAP+java add-on install.
    The UME is by default ABAP engine.
    From Portal:
    1 I create a portal user, it ALWAYS creates ABAP user in ABAP engine.
    2. I create a portal role, it creates a role in the Portal.
    3. When I assign the user this portal role,
    having worksets and pages,
    I get no pages or worksets shown in the portal page as soon
    user logs in.
    Can you help configure this so that I could see the pages and iviews inside this workset when user logs in.
    Thanks  a lot.

    Hi Mike,
    You did right,
    Just check the Entry Point Property of your iView, page and workset to YES
    there are two radio buttons yes and no select the yes one,
    you can see your pages afte rlogin with the new user.
    Regards
    Abhimanyu L

  • Display default Group space for users in a Role  upon login

    Is it possible to configure the role/group space so that the users in that role will see the group space as default page after logging into webcenter.
    Scenario:
    Group Space : G_SPACE1
    Role: W_ROLE1
    Uers with W_ROLE1: user1, user2, etc
    Requirement:
    Whenever users with role W_ROLE1 login to webcenter(http://..../webcenter ),
    they should see the group space G_SPACE1.
    Note: I am aware that we can access the group space directly with url as http://...../webcenter/spaces/G_SPACE1.
    Thanks-
    Sachin

    Hi,
    Not as far as I know. This is something I had a requirement to do but couldn't find a way.
    Although PS3 added support to configure the landing page/space for a user, it wasn't a very useful addition in my opinion. It only allows the admin to hard-code a single Space as the default for all users and doesn't work with ELs either.

  • Restiction on SAP Lumira user with BI_DATA_ANALYST role

    Hi,
    Is there an option to disable the SAP Lumira user with BI_DATA_ANALYST role from loading the Excel data into SAP Hana?   We would like the user to be able to create story boards and publish it on SAP LUMIRA server using HANA views but not allow him to load any flat file data.
    Thanks,
    Lakshmi

    Manish - if you are on BI4 there is no need for the SAP Integration Kit with Web Intelligence
    You can connect using the BEx Query
    For Lumira right now you can connect using the BEx query but only in the Visualize room - more enhancements are planned in 1.27 - see SAP Lumira Webcast including H1 Plans with BW Updates
    I don't think Gateway is needed in these scenarios
    Tammy

  • Console throws errors when check servers as user in Monitor role

    Hi ,
    I am getting the following error when trying to Login to console as a user with monitor role and This is working normal if logged in as Administrator, i am using WebLogic Server 9.2 MP3 -
    ####<May 5, 2010 5:14:06 AM EDT> <Error> <netuix> <isdwlprdx07> <prod-prr_admin> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <readonly> <> <> <1273050846842> <BEA-423405> <An exception [weblogic.utils.AssertionError: ***** ASSERTION FAILED *****] was thrown while rendering the content at [null].
    com.bea.portlet.adapter.scopedcontent.ActionLookupFailedException: weblogic.utils.AssertionError: ***** ASSERTION FAILED *****
    at com.bea.portlet.adapter.scopedcontent.ScopedContentCommonSupport.executeAction(ScopedContentCommonSupport.java:699)
    at com.bea.portlet.adapter.scopedcontent.ScopedContentCommonSupport.renderInternal(ScopedContentCommonSupport.java:268)
    at com.bea.portlet.adapter.scopedcontent.StrutsStubImpl.render(StrutsStubImpl.java:107)
    at com.bea.netuix.servlets.controls.content.NetuiContent.preRender(NetuiContent.java:288)
    at com.bea.netuix.nf.ControlLifecycle$6.visit(ControlLifecycle.java:427)
    at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:709)
    at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:721)
    thanks in advance ,

    Hi
    There is one more error i have noticed :
    java.lang.SecurityException: Method 'getState' cannot be invoked without administrator access
         at weblogic.rmi.internal.AdminAccessOnlyServerRef.getWorkManager(AdminAccessOnlyServerRef.java:29)
         at weblogic.rmi.internal.BasicServerRef.dispatch(BasicServerRef.java:307)
         at weblogic.rmi.internal.BasicServerRef.dispatch(BasicServerRef.java:885)
         at weblogic.rjvm.RJVMImpl.dispatchRequest(RJVMImpl.java:1084)
         at weblogic.rjvm.RJVMImpl.dispatch(RJVMImpl.java:1001)
         at weblogic.rjvm.ConnectionManagerServer.handleRJVM(ConnectionManagerServer.java:240)
         at weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:893)
         at weblogic.rjvm.MsgAbbrevJVMConnection.dispatch(MsgAbbrevJVMConnection.java:446)
    can any body help ??

  • 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

  • Assigning Users to a Role in a BPM Task

    Hi,
    Is it necessary to have User Admin access to add Users to a Role in a BPM Task ?
    Is there any work around to it ?
    Regards,
    Utsav

    Hi Utsav,
    Yes you require User Admin role to search and add UME Users.
    A workaround can be using the 'Use an Expression' :
    User: getPrincipalByUniqueName(string uniqeName,"user")
    Role: getPrincipalByUniqueName(string uniqeName,"role")
    Regards,
    Unni

Maybe you are looking for

  • Step By step procedures  for various scenarios Required ASAP!!!!!

    Hi All, Pls mail me the step by step procedure of the following scenaios. 1.) File-XI-File Scenario. 2.) Text file scenario. 3.)File to Idoc 4.)File XI- RFC.(R/3) 5.) BPM scenarios. any stuff related pls mail to [email protected] Thanks in Advance. S

  • I want to send a clip from FCP to Motion

    i am selecting a clip in my sequence and using the 'send to motion' menu but when it comes up in Motion it's not the clip i selected. It is using the out point for the clip i selected as the in point and making a new out point at the duration of the

  • MM stock vaule help req?

    hi I need to develop a reprot for the stock for a material/plant/month. The selction-screen:1.material,2.plant,3.purch grp,4.month output:PLANT,MATERIAL,PURCH GRP,OPENING BAL(Total Stock avaible/month),ISUUE STOCK VALUE(/month),CLOSING BLANCE(Total S

  • ¿Desde donde puedo descargar el programa adobe suite cs5 design premium retail en español?

    Tenemos una licencia de adobe suite cs5 design premium retail, pero hemos perdido los cds ¿Desde donde puedo descargar el programa? En la parte de downloads solo esta la versión en ingles y mi licencia no funciona, necesitaría el producto en español

  • TNS-12547: TNS: Lost Contact

    I installed Oracle8i on Windows NT EE edition with SP6a. It passed the test in Net8 Assistant. But after I installed a nother package and I tried to test again with: cmd> TNSPING MAchineName, I got "TNS-12547: TNS: Lost Contact". Thanks. Robert