Read the user-role of TomCat in Struts

Hi guys !
I'm developping an application based on tomcat and struts. I have securize my application with tomcat and I want to know if it's possible to get the role name of the user in an struts action class ?
How can I do that ?
Thank you in advance.
Bye

The struts action class has access to the HttpSession object (session). I think the role is stored in there somewhere..
//inside Action
HttpSession session = request.getSession();
String role = (String)session.getAttribute("role");
if(role.equals("admin"){
    //do the naughty business
}Correct me if the name of the attribute is not "role", please.

Similar Messages

  • Function module to modify the user roles & profiles

    Hi All,
    I am working on user maintenance and i need a function module to modify the user roles & profiles.
    Thanks in Advance.
    Phani.

    i used the below fms
    BAPI_USER_ACTGROUPS_ASSIGN for assigning the roles.
    delete the profiles of the user qnd assign the profiles to the user:
    BAPI_USER_PROFILES_DELETE
    BAPI_USER_PROFILES_ASSIGN
    i used the above FMs for my requirement.
    Regards,
    Phani.

  • Read the business role in the code

    Hi Gurus,
    My Requirement is to diffrenciate codes based on business role. More like below pseudo code
    if BRole1.
        code 1 will be executed
    elseif BRole2
       code 2 will be executed
    else.
       code 3 will be executed
    endif.
    Can you please let me know how to read the business role programatically in SAP CRM.
    Appreciate your help
    Regards
    Sudipto

    Hi Sudipto,
    Try to check here:
    Business Role of logged in user
    Kind regards,
    Garcia

  • I want to check all functions of PCI 6534.I have read the user manual..I have some memory related questions.​Please help me for that.

    I want to check all functions of PCI 6534.I have read the user manual..I have some memory related questions.Please help me for that.
    1.)If i am using the continuous output mode.and the size of generated data is less than 32 MB.If i want to preload the memory,what should i do?I want that first of all i load all my data to onboard memory & then i want to make start the transfer between 6534 & peripheral.Is it possible?As per me it should be.Plz tell me how should i do this?I think that in normal procedure the transfer between 6534-peripheral & outputting data from pc buffer to onboard memory works parallely.But i don't want this.Is it poss
    ible?
    (2).Similarly in finite input operation(pattern I/O) is it possible to preload the memory and then i read it?Because i think that the PC memory will be loaded automatically when 6534 acquires the data and then when we use DIO read vi the pc buffer data will be transferred to application buffer.If this is true,i do not want this.Is it possible?
    (3) One more question is there if i am using normal operation onboard memory will be used bydefault right?Now if i want to use DMA and if i have data of 512 bytes to acquire.How will it work and how should i do it?Please tell me the sequence of operations.As per my knowledge in normal DMA operation we have 32 Bytes FIFO is there so after acquisition of 32 bytes only i can read it.How it will known to me that 32 bytes acquisition is complete?Next,If i want to acquire each byte separately using DMA interrupts what should i do?Provide me the name of sourse from which i can get details about onboard memory & DMA process of 6534 specifically
    (4).In 6534 pattern Input mode,if i want to but only 10 bits of data.and i don't want to waste any data line what should i do?

    Hi Vishal,
    I'll try to answer your questions as best I can.
    1) It is definitely possible to preload data to the 32MB memory (per group) and start the acquisition after you have preloaded the memory. There are example programs on ni.com/support under Example Code for pattern generation and the 6534 that demonstrate which functions to use for this. Also, if your PC memory buffer is less than 32MB, it will automatically be loaded to the card. If you are in continuous mode however, you can choose to loop using the on-board memory or you can constantly be reading the PC memory buffer as you update it with your application environment.
    2) Yes, your data will automatically be loaded into the card's onboard memory. It will however be transferred as quickly as possible to the DMA FIFO on the card and then transferred to the PC memory buffer through DMA. It is not going to wait until the whole onboard memory is filled before it transfers. It will transfer throughout the acquisition process.
    3) Vishal, searching the example programs will give you many of the details of programming this type of application. I don't know you application software so I can't give you the exact functions but it is easiest to look at the examples on the net (or the shipping examples with your software). Now if you are acquiring 512 bytes of data, you will start to fill your onboard memory and at the same time, data will be sent to the DMA FIFO. When the FIFO is ready to send data to the PC memory buffer, it will (the exact algorithm is dependent on many things regarding how large the DMA packet is etc.).
    4) If I understand you correctly, you want to know if you waste the other 6 bits if you only need to acquire on 10 lines. The answer to this is Yes. Although you are only acquiring 10 bits, it is acquired as a complete word (16bits) and packed and sent using DMA. You application software (NI-DAQ driver) will filter out the last 6 bits of non-data.
    Hope that answers your questions. Once again, the example code on the NI site is a great place to start this type of project. Have a good day.
    Ron

  • On the web how can I check the user role to display the form suitable for this role i

    Hello
    How can I check on the web the use role to display the a form for each role
    Example
    If the admin login I display admin_form.fmb and if user login I display
    user_form.fmb
    Thankx
    Tamer

    In my forms I hide tab pages according the role using something like the following script in the WHEN_NEW_FORM_INSTANCE trigger.
    So the user can not navigate to tabs which are vorbiden by his role.
    CURSOR users_roles_cur IS SELECT granted_role FROM user_role_privs
    WHERE username=(SELECT user FROM dual);
    user_roles_rec users_roles_cur%ROWTYPE;
    IF users_roles_cur%ISOPEN
    THEN
    CLOSE users_roles_cur;
    END IF;
    OPEN users_roles_cur;
    LOOP
    FETCH users_roles_cur INTO user_roles_rec;
    EXIT WHEN users_roles_cur%NOTFOUND;
    MESSAGE (user_roles_rec.granted_role);
    PAUSE;
    IF RTRIM(user_roles_rec.granted_role,' ') = 'BLA-BLA'
    THEN
    tb_pg_id := FIND_TAB_PAGE('activity');
    IF GET_TAB_PAGE_PROPERTY(tb_pg_id, visible) = 'FALSE' THEN
    SET_TAB_PAGE_PROPERTY(tb_pg_id, visible, property_true);
    END IF;
    END IF;
    END LOOP;
    CLOSE users_roles_cur;
    Other solution may be is to use an initial form which only will detect the user role and run the appropriate form.
    Other solutions are also possible.
    Joseph

  • How check the user roles in Business Partner edition screen?

    Hello Masters,
    I'm having a little problem figuring out how to check the user roles to allow modification in some fields.
    At the 'Manage Organizational Data' screen ('Manage Business Partners' -> Business Partner Data -> edit). I need to check the user roles to let him change the 'Tax Numbers' values. The values can be changed only if the user is a administrator; otherwise it must only show the value.
    I checked the HTML Template and found where I can restrict this edition option, but the problem is that I don't know how to check the user roles here. Maybe there is a function to do this?
    Any ideas of how I can do it? Is there any magical BAdI to check this?
    Thanks in advance,
    José Omar

    Hi José Omar,
    there is no BADI for this...
    You have to change the standard code to display only tax data if the SY-UNAME does not have correct role.
    You can retrieve user roles with BAPI_USER_GET_DETAIL, or access directly the activity groups table.
    Rgds
    Christophe

  • How do I see the users/roles which have quota access to a Tablespace?

    How do I see the users/roles which have quota access to a Tablespace?
    Thanks

    Thank you very much.
    select username from dba_ts_quotas where tablespace_name='&tablespacename';
    did the job!
    regards

  • One or more Object are missing in the User Role

    How to assign/add Objects to the User Role?
    Thank you in advance

    I dont understand exactly what you want to say...r u talking about how to generates roles..
    Pls visit the PFCG transaction enter the role name
    now goto change mode and maitain the values..or the object..
    From the SAP menu you can switch on the technical names for ur reference.
    Regards
    Prakhar

  • How to assign a Bex report to the user role

    Hi Expert
    in the Excel, when you open a query, the system will display history, faviourate, infoarea, role button on the left side of the popup screen. if you click the role button, you can see the user authorized Bex report. now I have created a Bex report and I want to assign it to the user role.
    how to do that?
    does anyboday know which transcation or setting can solve this problem?
    thank you in advance!

    Hi,
    You need to add the object S_RS_COMP:
    S_RS_COMP: Authorizations for using different components for the query definition. This authorization object is very important for reporting
    The authorization object S_RS_COMP restricts query component activities. For example, it restricts if someone can create queries, change queries, or execute queries. You can restrict query creation, change, and execution by the InfoArea and InfoCube. If your company has one InfoCube for sales information and another for financial data, you can restrict a user to only those queries written for the sales InfoCube or the financial InfoCube.
    You could also use S_RS_COMP if you want to protect by query name. For example, you have an InfoCube for sales data. Every sales manager needs access to this InfoCube. However, sales managers in different lines of business are not allowed to execute the same query.
    Please visit:
    http://www.*********************/bw_security/bw_security_auth_obj_2.htm
    to know more about BW Objects.
    Hope it helps.
    Please award points if it is useful.
    Thanks & Regards,
    Santosh

  • Sychronisation AD - OID: Is it possible to read the user password from AD?

    Hi.
    We are using the Oracle Internet Directory shipped with the Oracle 9i Database Rel. 2 (9.2.0.1).
    I try to synchronise the user accounts from AD to OID using JAVA JNDI. I'm able to read all necessary user information except the user password (MD5 value). Even if I connect to the AD using SSL, it's not possible to read the attribute userPassword.
    Is anybody out there who got this work or knows a way (may also be by the use of another programming language or tool) to get the user password out of AD? Is this possible? How does the Oracle Integration Agents accomplish this?
    Thanks in advance.
    Hermann S.

    Hermann,
    I am working with this as well, though from AS10g, not RDBMS. According to the OID Administrator Guide chapter 43, page 43-52:
    <snip>
    Synchronizing passwords from Microsoft Active Directory to Oracle Internet Directory is not possible in the Oracle Application Server 10g release because passwords in Microsoft Active Directory are not accessible by LDAP clients. However, if a deployment requires passwords to be available in Oracle Internet Directory, then the following two methods are recommended:
    Build a custom plug-in for Microsoft Active Directory that captures a password change and synchronizes it with Oracle Internet Directory
    Manage Active Directory passwords from the Oracle environment. This enables passwords to be available in both Oracle Internet Directory and Microsoft Active Directory because the Active Directory connector can synchronize passwords from Oracle Internet Directory to Microsoft Active Directory.
    </snip>
    As10g can however look up the password in AD using the "Active Directory External Authentication Plug-In". This is documented in the same chapter.
    Hope this helps,
    Jens

  • Can Drill-down paths being made dependent on the user roles and groups

    Hello Experts
    Is it possible to restrict user after certain level of drill down. Here I mean after drilling upto country level from Total World , can we restrict the user to further drill down upto state level.
    OR we can say that we need to restrict certain user to look into transaction level details
    thansk and appreciate any hlep on this.

    i Guess u can...by setting object level security? suppose if you dnt want to drill to state... you can restrict the state column inpresentation laye... so when the user uses the the report he cannot see state and also in drill down....hope this is helpful/answered...

  • Using IE3.5, users  can't read the user account/password page

    We are currently using IE3 to access Netscape mail. Before the upgrade
    from 2.0 to 3.5, users on IE3 could go access their user account page and change
    password information. After the upgrade to version 3.5, all clients using
    IE3 are unable to read the information now.
    <P>
    Is there a workaround solution?
    <P>
    Use IE4.xx or Netscape Communicator 4.xx. Make sure Javascript is enabled in
    the Advanced Preferences section.

    check these will be helpful BI Dashboard - access denied for user to path /users/administrator/_portal/
    http://obiee-blog.info/administration-tool/error-access-denied-for-user-to-path/
    Cheers,
    KK

  • Error opening the entities in the user role management

    I am trying the assign the models to the user in the user management page. But when  I try to expand the + symbol next to the model and open the entities, I get the error that the object reference is not set for a object server instance.Can you
    please guide me on this

    Hi Vincent,
    Thanks a lot. it works now.
    Regards
    Ganesh

  • Set of user roles in Tomcat servlets

    I'm using Tomcat's role based authentication scheme for security of my web application and want to build a servlet to show a dynamic options menu based on the authenticated user's roles using my role-option table (with option and role columns). I want to know how to programatically obtain the set of roles of the authenticated user, independent from the type of the security realm used(MemoryRealm, JDBCREalm, JNDIRealm, etc)

    When I was looking at this a year ago I fired off an email to the JAAS guys and the servlet guys. I don't think there's anything that will help you that's in the standards. Perhaps websphere has its own API. I ended up punting and writing my own security layer using Filters and JAAS, with the drawback that my web server security doesn't flow into the EJB tier. Good luck with your project.

  • How to find the user - role assignments in the database for EP6 SP9?

    L.S.,
    We have a quite specific requirement: to see which users have access to our portal environment (EP6 SP9). It does not immediately matter (though would probably still be nice to know if possible) which roles users have exactly.
    I've been looking in the database to find user-to-role assignments there, but I'm unable to find any. The closest I got is the PID filed in the UME_STRINGS table, but users remain listed there even when all their portal roles are revoked afterwards. Any ideas?
    Kind Regards,
    Steven Dijkman

    hi Steven,
         Sorry but you will have to write some code. the following lines of code will work for you.
    IRoleSearchFilter rolefilter = UMFactory.getRoleFactory().getRoleSearchFilter();
              ISearchResult result = UMFactory.getRoleFactory().searchRoles(rolefilter);
              while (result.hasNext()) {
                   String rolestr = (String) result.next();
                   IRole r = UMFactory.getRoleFactory().getRole(rolestr);
                   response.write(r.getDisplayName());
                   response.write("<br>");
                   Iterator users = r.getMembers(true);
                   while (users.hasNext()){
                        String userstr = (String)users.next();
                        IUser user = UMFactory.getUserFactory().getUser(userstr);
                        response.write(user.getDisplayName());

Maybe you are looking for

  • Programatically closing an execution

    I havedeveloped a custom TestStand UI in LabVIEW. However I have run into a smallproblem I wasn't able to tackle. A useris allowed to load a sequence and then execute it. He can also stop theexecution. Load another sequence and run that sequence. Ino

  • Operation on internal table

    Dear experts, I have 2 internal table , 1 inernal table have 4 fields and 10 records in that and the other hv 3 fields and 10 records in each field in that . My task is to transfer the 4th field and records of that of 1st table to 2nd field. Need som

  • Error while trigerring Outbound Proxy

    Hi , I am trying to execute a Proxy to File Scenario. While trigetting a proxy I get the following error. GET_BUSINESS_SYSTEM_ERROR, An error occured while determining the business system. I have checked previous posts related to the same issue and a

  • Question about using net time

    I am trying to synchronize the time of my machine with another machine (target) on the local network by using "net time" command and found something strange for me. If I change the local time on my machine and then use "net time" to read or synchroni

  • In Krishna moorthy's weblog

    Hi Moorthy, In your weblog---Walkthrough with BPM /people/krishna.moorthyp/blog/2005/06/09/walkthrough-with-bpm While creating 2nd receiver determination sender: IP_File_To_File Receiver: BS_FILE_BPM I am not getting Receiver Agreement (Communication