Getting Logged in user roles

Hi EveryOne,
We are developing repository filter.  Here we need to check roles of loged in user. How can we get role names  in repository filter application?.
Thanks in advance,
Venkatesh.R

Hi Venkatesh
You can refer to your doubts in through the folowiing PDF
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3641e490-0201-0010-c68f-e51221925714
http://help.sap.com/saphelp_nw2004s/helpdata/en/2b/306bb5bc98f24f8a85d489449af456/frameset.htm--
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/library/ep/_s-u/Using%20The%20New%20User%20Management%20API%20in%20EP%206.0
For getting Logged on user details
String presentuser=null;
               IWDClientUser wdUser = WDClientUser.getCurrentUser();
               IUser user = wdUser.getSAPUser();
               presentuser=user.getUniqueID()
you will have to get com.sap.security.api.jar
(Path C:\Program Files\SAP\IDE\IDE70\eclipse\plugins\com.sap.security_2.0.0\lib\com.sap.security.api.jar.  //// the path is the installed directory of NWDS )
Thanx
Pankaj

Similar Messages

  • How to get logged in user name from windows service c#

    i use the below code to get logged in user name.
    private string GetLoggedInUser()
    string userName = "";
    if (System.Security.Principal.WindowsIdentity.GetCurrent() != null)
    userName = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
    return userName;
    just do not understand why it is not giving a logged in user name rather it is return data in this format
    NT AUTHORITY\SYSTEM but i want to get user name.
    i try to run my service as Local Service and local system account but in every case i am getting this string
    NT AUTHORITY\SYSTEM instead of logged in user name.
    so please guide me what to change in code. thanks

    System is the account the service is running under.
    There can be none or many interactive users be logged in. What if none or multiple are logged in? Which one are you referring to then?
    Armin

  • Getting Logged on User'Information in an Oracle-Form SSO Partner Application

    Hi.
    I could run Flight-of Fancy Application and capture user's information by calling the
    "Parse_cookie " Procedure.(use the Scenario 2 - Access the Portal and then the FOF App)
    and defined an Oracle-Form application as Partner application like FOF.
    I want to have Logged on user'Information in the "Oracle-Form" . But the Fucntion owa_cookie.get dosen't work correctly.please let me know what can I do ?
    Thanks in advanced.

    Hi.
    I could run Flight-of Fancy Application and capture user's information by calling the
    "Parse_cookie " Procedure.(use the Scenario 2 - Access the Portal and then the FOF App)
    and defined an Oracle-Form application as Partner application like FOF.
    I want to have Logged on user'Information in the "Oracle-Form" . But the Fucntion owa_cookie.get dosen't work correctly.please let me know what can I do ?
    Thanks in advanced. If you're writing your own partner application, then you are correct to get the user information from the output variables
    from the parse_url_cookie procedure. You should then set the information you want to keep track of in the cookie, or combination
    of cookie and persistent storage in the database. Take care of the security implications while doing this.
    On subsequent calls to your application, the user info should be obtained from the cookie and the database, if you
    are using a combination of the cookie and database storage to keep your info.
    The owa_cookie.get routine is used to read the cookie, which is generated with owa_cookie.send.
    These routines work fine, when invoked correctly.
    If you are having trouble with them, you're probably not using the calls properly.
    The following code provides an example of how to use the owa_cookie calls...
    create or replace package testcookie
    is
        procedure show (p_name IN VARCHAR2);
        procedure send
            p_name    IN VARCHAR2,
            p_value   IN VARCHAR2,
            p_path    IN VARCHAR2 default null,
            p_expires IN VARCHAR2 default null
    end testcookie;
    show error package testcookie
    create or replace package body testcookie is
        procedure show (p_name IN VARCHAR2) is
            v_cookie owa_cookie.cookie;
        begin
            v_cookie := owa_cookie.get(upper(p_name));
            htp.htmlopen;
            htp.bodyopen;
            htp.print(v_cookie.vals(1));
            htp.bodyclose;
            htp.htmlclose;
        exception
            when others then
                htp.htmlopen;
                htp.bodyopen;
                htp.print('NO COOKIE FOUND.');
                htp.print(SQLERRM);
                htp.bodyclose;
                htp.htmlclose;
        end;
        procedure send
            p_name    IN VARCHAR2,
            p_value   IN VARCHAR2,
            p_path    IN VARCHAR2 default null,
            p_expires IN VARCHAR2 default null
        is
            v_cookie owa_cookie.cookie;
            l_agent varchar2(30);
            l_expires varchar2(30);
            l_path varchar2(100);
        begin
            if p_expires is null then
                l_expires := null;
            else
               l_expires := to_date(p_expires, 'MMDDYYYY');
            end if;
            if p_path = 'ALL' then
                l_path := '/';
            else
                l_path := null;
            end if;
            owa_util.mime_header('text/html', FALSE);
            l_agent := owa_util.get_owa_service_path;
            l_agent := substr(l_agent, 1, length(l_agent) - 1 ) ;
            owa_cookie.send(
                name    => upper(p_name),
                value   => p_value,
                expires => l_expires,
                path    => l_path
            owa_util.http_header_close;
            htp.htmlopen;
            htp.headopen;
            htp.headclose;
            htp.bodyopen;
            htp.print ('Cookie set.');
            htp.bodyclose;
            htp.htmlclose;
        end;
    end testcookie;
    show error package body testcookie;
    grant execute on testcookie to public;If you load this into a schema which a DAD can access, then you can invoke the show and send procedures to view and
    generate cookies.
    To generate a cookie, issue the following from your browser ...
    http://server.domain.com/pls/dad/schema.testcookies.send?p_name=test&p_value=hello
    To view the cookie:
    http://server.domain.com/pls/dad/schema.testcookies.show?p_name=test

  • How to get Logged-in user detail from solution Manager.

    Hi to all,
             How can i get details of a user who is logged in into SAP Solution Manager through my webDynpro application. I need to read some values from SAP Solution Manager. How could i do it?? Shall i need to call RFCs??
    If anybody have idea please reply.
    If anybody has some code please send it.
    Points will be rewarded.
    Thanks in advance.

    Pankaj,
    Here is the code to get the logged in user in Web Dynpro.
         //Get the current logged user information
         IWDClientUser user = WDClientUser.getLoggedInClientUser();
         IUser usr = user.getSAPUser();
    String userId = usr.getUniqueName();
    Regards,
    Anand

  • How to get logged-in user/group information in WebLogic Portal 10.3.2

    Hi bros.
    I have a codesnipet to get information about user who actually logged in weblogic portal:
    import javax.security.auth.Subject;
    import javax.security.auth.login.LoginException;
    import com.bea.p13n.security.Authentication;
    import com.bea.portal.tools.security.user.*;
    public class UGMSummary {
         private static final String username = "weblogic";
         private static final String password = "webl0gic";
         public UGMSummary(){
         public void test(){
              try {
                   Subject tmp = Authentication.authenticate(username, password);
                   //PolicyItem pi = new PolicyItem();
                   //System.out.println("######## " + Authentication.getCurrentSubject().toString());
                   UserIDBuilder builder = new UserIDBuilder();
                   UserID uid = builder.createResourceID();
                   System.out.println("######## Admin ? " + Authentication.isAdministrator(tmp));
                   System.out.println("######## Anonymous ? " + Authentication.isAnonymous(tmp));
                   System.out.println(" ######## " + uid.getUserName());
              } catch (LoginException e) {
                   System.out.println(e.getMessage());
                   //e.printStackTrace();
    }Some println commands above are used to mark in console. I can ensure that there is an user (admin) logged in weblogic system by executing command: Authentication.isAdministrator(tmp);
    Output of codesnipet above is:
    ######## Admin ? true
    ######## Anonymous ? false
    ######## nullMy problem is impossible to use UserID object to get username of weblogic user. Output of command: uid.getUsername() is: null
    Somebody tell me why my code doesn't work though it can authenticate an user.
    Thank in advance.
    ps:
    Some Javadoc for UserID can be found here:
    http://download.oracle.com/docs/cd/E15919_01/wlp.1032/e14255/index.html
    http://download.oracle.com/docs/cd/E15919_01/wlp.1032/e14255/index.html

    Hi, Kevin.
    I'm glad to see your response again. I found some interesting information from your recommendation link. At this time, I know that impossible to get users/groups information by using DelegatedAtnProxyManagerControlFacade (ref: http://download.oracle.com/docs/cd/E15919_01/wlp.1032/e14255/com/bea/portal/tools/ugm/controls/DelegatedAtnProxyManagerControlFacade.html) interface.
    But, I dont know how to get an instance of an object that implemented this interface. My friend give me a codesnipet that shown the way to get a DelegatedAtnProxyManagerControlFacade by using this codesnipet in a GlobalController:
          try
            DelegatedAtnProxyManagerControlFacade delegatedAtnProxyManager = (DelegatedAtnProxyManagerControlFacade)getControl(DelegatedAtnProxyManagerControlFacade.class);
          catch (PolicyRefException e)
            reportPolicyRefException(e);
          catch (OperationNotSupportedException e)
            reportOperationNotSupportedException(e);
          }But I dont know what global.GlobalController actually is ?
    I've asked Google for information but I got nothing. Do you know any documentation that describes about this controller ?
    Thanks, regards !
    Doubt_Man.

  • CR 2008 Get logged in user ID

    Hi all,
    I am working on a CR 2008 report that connects to a SQL Server 2008 database.
    The data on the report is retrieved using a stored procedure that takes the NT user ID as a parameter to  get the correct results.
    As the SQL Server connection uses a generic user, I need Crystal Reports to retrieve at run time the currently logged in user that's executing the report in CR Viewer to pass it to the stored procedure.
    Is there any way to accomplish this? I've seen some UFL's that do that, but if I use them, when opening the report in viewer it crashes saying it can not correctly compile the function (but it works if I open the report in CR 2008 Developer).
    Anyone can please help me?
    Thanks!
    Jordi.

    The only alternative I'm aware of is a 3rd-party Crystal Reports viewer (see same list) that can automatically set a report parameter to the logged in user id.  Actually, for your situation this is much better because you can't use a formula value as a parameter, unless you feed it to a subreport.
    Again, I know for sure that at least one the viewers listed at http://www.kenhamady.com/bookmarks.html provides that functionality.  I can't name the specific viewer because of forum etiquette.

  • Get logged in users name for email notification

    Hi all,
    I am using LC Update 1 with email notifications. In the notification email I would like to write:
    Hi "logged in users name"
    You have got a task in your to do-list...
    The thing is that I can not get the id of the user because the email is sent before he/she completes any step in the process. So I guess I need to look up the user in the same way as the notification-function makes the lookup... How is this done?
    Can you help me here?
    Sincerely
    Kim

    You can use a parameter for the user ID:
    http://livedocs.adobe.com/livecycle/8.2/wb_help/001330.html
    scott

  • OIM - get logged in user id

    Hi All
    How can I get the requestor's information or the user id of the user who is logged in inside the Action.java file. e.g. I have an action class method as enableUser and it is defined as:
    public ActionForward enableUsers(ActionMapping poMapping,
                   ActionForm poForm, HttpServletRequest poRequest,
                   HttpServletResponse poResponse) throws IOException,
                   ServletException {
    Please let me know how I can derive the requestor's info from poRequest or some other parameter.
    Thanks

    Call the API getSelfProfile of UserOperationInterface.

  • How to get  log of user's delete action on Content Items?

    Hi all,
    When one user edit a Content Item, we can get the log about this action. But when user delete this content Item, I couldn't find out the log about this action.
    I wonder that WebCenter Content have any function to logging the delete action on Content Items?
    If it have, where I can find it ?
    Thanks a lot!

    If you are strictly interested in just "deletes", you can query the table "DocumentHistory". Basic data like checkin, checkout, update, and delete actions against a document is recorded there, along with the user and date.
    If you need deeper data however, as Srinath noted, Content Tracker is built for those deeper requests.

  • Get inf. about user, rol and group, which shows and works on my webdynpro ?

    Hi everybody,
    Can someone help me? I need the information about rol and group of the user, who's show and work on my webdynpro?

    Hi,
    You can use the below code to get the information you need. You need to add the jar file com.sap.security.api.jar to your Web Dynpro project's build path.
           IRoleFactory roleFactory= UMFactory.getRoleFactory();
        IGroupFactory groupFactory = UMFactory.getGroupFactory();
        try
         IWDClientUser wdUser = WDClientUser.getCurrentUser();
         IUser user = wdUser.getSAPUser();
         Iterator assignedRoles = user.getRoles(true); // true means all the roles are searched recursively
         Iterator assignedGroups = user.getParentGroups(true); // true means all the groups are searched recursively
         while(assignedRoles.hasNext())
              String roleID = (String)assignedRoles.next();
              IRole role = roleFactory.getRole(roleID);
              String roleName = role.getUniqueName();
         // Fill your model node with the role
         while(assignedGroups.hasNext())
              String groupID = (String)assignedGroups.next();
              IGroup group = groupFactory.getGroup(groupID);
              String groupName = group.getUniqueName();
         // fill your model node with group.
        catch(Exception ex)
             messageManager.reportException(ex.getLocalizedMessage(),false);

  • Getting logged in user id in EJB

    Hi All,
         I have a session bean which will be exposed as webservice and will be consumed in webdynpro. Both by EJB and webdynpro are running on the same WAS . Is it possible to retrive the logged in portal user id in the EJB insted of webdynpro . if so can you please provide how it can be done.
    Regards,
    Raj
    Edited by: Raj A on May 27, 2008 6:02 AM

    I found this WIKI and thread
    retriving user details from user rofile in portal database
    /people/sap.user72/blog/2005/06/05/user-management-api-in-webdynpro
    Which says that below code
    IUser iUser = user.getSAPUser();
    getSAPUser() method, though it says SAP User it's not direct retireval from ABAP, it's from SAP Web App Server user which could be any datasource (R/3, LDAP, Portal UME). 
    If you read in the blog right at the bottom in the user comments sections you will find clarification on getSAPUser and portal user.  This answers my question that I can use user.getSAPUser() method irrespective of user datasource(r/3, LDAP, UME).
    If my understanding is wrong please advise.  I'm marking this thread answered.
    Thanks
    Praveen
    Edited by: Praveen11 on Oct 16, 2009 3:14 AM

  • How can I know the security role of the logged in user

    When you design an enterprise bean or Web component, you should always think about the kinds of users who will access the component. For example, an Account enterprise bean might be accessed by customers, bank tellers, and branch managers. Each of these user categories is called a security role, an abstract logical grouping of users that is defined by the person who assembles the application. When an application is deployed, the deployer will map the roles to security identities in the operational environment.
    But wondering when I log into my application with some user name and password (specified in my Oracle database),wondering how this works with the security role I created .How does J2EE know the security role of the logged in user.
    Thanks
    Manohar

    shet wrote:
    role at run time.
    When I login say as "manju" and password as "money" then how does it know that this user belongs to this security role.Is that the j2ee administrator has to say that user manju has this this security role.Programmitically how does it really work.I am confusedThe j2ee implementation assigns the roles using the JAAS module you have configured for your application on your application server. different JAAS modules get roles in different ways. many allow a single static role to be assigned using a config file. if using a database, often there will be configuration to specify additional database fields which specify the role for a given username.
    At runtime, a developer can test roles using methods like EJBContext.isCallerInRole().

  • Determine the role of the logged in User

    Dear experts,
    I am working on SRM 7.0 version, I want to determine wether the logged in user is an approver, buyer or a general user ( Role determination ). Can you please suggest a way for this.
    Thanks & Regards,
    Murthy

    Hello Murthy,
    What about simply use function module BBP_USER_GET_DETAIL with importing parameter USERNAME = SY-UNAME ?
    You will get all user's roles in table ACTIVITYGROUPS.
    Regards.
    Laurent.

  • Getting User Role in JSPProvider

    Hi,
    I am developing a simple News portlet which displays different news based on the role of the logged in user.
    I am planning to use a simple JSPProvider that has a JSP which includes a different news jsp for each different role. Howeve, i donot know how to get the role of logged in user from the JSP. I've figured out how to get other properties (username, telephonenumber etc) but would appreciate if anybody could point me to appropriate place or give a simple example on how to get role of logged in user from the JSP of JSPProvider.
    Thanks,
    Apoorv

    Thanks a lot Nathalie.
    I think you are right. In real life, what you say is correct. But i was just playing around and wanted to do that.
    Really appreciate your help.

  • WebCenter user role not getting propagated

    Hi,
    I am creating a WebCenter WSRP portlet application. I expected, after registering the application as a portlet, when I will consume it in WebCenter, the currently logged in user's name and role will be accessible. But in my case, when I am trying to check the logged in user's role using request.isUserInRole(...) method, it always return false. When I debugged the application, I saw that the user role is empty.
    Can someone please help me understand, if I have to do anything to successfully propagate the logged user's role to the custom portlet application.
    Just so you know, I could access the logged in user's name using request.getUserPrincipal().getName(). Please help.
    Thank you,
    Kanchan Upadhyay

    Hi,
    Yes, I am using LDAP and everything else in webcenter works fine. Just the user role is not getting propagated to my custom application developed using portlet. I have tried in taskflow also, seems like the user role is not accessible from there as well. Is there any specific way of accessing user information for custom application hosted in webcenter as portlets?
    Your help is appreciated!!
    Thank you,
    Kanchan

Maybe you are looking for

  • What is the deal with the screwy scaling in Safari?

    Ever since the last update (5.1.7) some Web pages come in overscaled, some underscaled. By using the zoom +/- and/or the A/a I can correct most of the problems. But there are still headers, Flash placemats, and Ad placemats that are not scaled to the

  • Mail stops checking for new mail until closed and re-opened

    This problem began a month or so ago and is only getting worse by the day.  I have my Mail app set to check for new mail every minute, but recently it randomly stops checking at all and displays the triangle icon next to each Inbox.  I have 10 differ

  • Why no "Create AAC version" option?

    Using several online tutorials as a guide, I'm trying to use iTunes 10 (Windows XP) to convert a 30-second mp3 file into a ringtone. The tutorials say that even in 10, I should be able to right-click a song and have "Create AAC version" on the contex

  • HOW TO USE LEXICAL PARAMETER IN FORMS9I

    CAN I USE LEXICAL PARAMETER IN FORMS9I I WANT TO CREATE QUERY LIKE THIS SELECT * FROM &TABLE_NAME WHERE &CHOICE WHERE &TABLE_NAME = EMP, AND &CHOICE EMPNO=12344 PLS HELP

  • There is a wrong in Oracle Application Express Advanced Tutorials

    In the charpter 6 of Oracle Application Express Advanced Tutorials Release 3.2, I tried the " create multi value check boxed to filter content" (6-8 page) exercise, but I couldn't find the search field (P1_REPORT_SEARCH) under the page definition ite