Display buttons based on some role

I have user log into the app with some roles ex admin, user, manager etc. When they login, they come to a list page. there on the top of the page there is a button which will take to a report page. when you click on that button will take you to the report page where I have several buttons to run reports. Now I need to restrict user to view some buttons. example, admin can view all the buttons and run them. manager can run only some report and so does users. how can i do this easy way?
Any sample, suggestion or help is appreciated.

You could create a roles object that is basically an associative array, with the keys being the role name and the value being a number, like 1, 2, 3, 4, 5.
Then test their access using the roles object using their role name, and only show that area of the UI if the value is >= the required number for that area of the UI.
If this post answers your question or helps, please mark it as such.
Greg Lafrance - Flex 2 and 3 ACE certified
www.ChikaraDev.com
Flex / AIR Development, Training, and Support Services

Similar Messages

  • Conditionally display button based on number of rows in rpt query results?

    I know that I can conditionally display a button based on the number of rows returned in a query entered in the condition. However, I have a report region button that I only want to display if any data was returned by a report query. Since I've already executed the query to generate the report, I do not want to execute it again to determine whether any rows were returned. Is there any way to detect whether any rows were returned for a report other than to reissue the query?

    http://htmldb.oracle.com/pls/otn/f?p=24317:52
    OK, so it looks like it contains the rowcount of the report region rendered just before the variable (apex_application.g_flow_total_row_count) is referenced.
    Sort of like how SQL%ROWCOUNT contains the no. of records affected by the last SQL DML statement.
    Note that the pagination scheme affects the result. In the example above, the 2nd report region is showing 10 rows with a 'Rows X to Y' pagination scheme. So g_flow_total_row_count=11 because I guess the reporting engine has to fetch the 11th row (and discard it) to determine whether to render the 'Next' pagination link.
    If you select a pagination scheme that forces the reporting engine to fetch all the rows 'Rows X to Y of Z', g_flow_total_row_count will always be Z, not the number of rows actually rendered on the screen.
    Thanks

  • How to hide the buttons based on some conditions

    Dear all
    Good morning
    i have three pages
    when ever user directly go to third page i want to hide the button "backtofirstpage"//button name
    when user go to third page via first page i mean first page i want to visible the button "backtofirstpage"/button name
    what is the procedure
    at least hiding is not posible at least disable/enable
    Regards
    Sreekanth

    Hi,
    In the if condtion read the value of parameter [[You need to send it from first page]] and get it in process Request Method of controller of third Page and based upon it set the render property of that button & in the else condition set the render property to false.
    You need to create a PVO & also create a Boolean attribute.
    Set the render property in Property window like ${oa.xxPVO1.setRender} -- ${oa.viewInstanceName.viewAttributeName}.
    Read more in dev guide & search through the forums.
    Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • In my output fianl int. table how to display 'X' based on some conditions

    Hi,
    can somebody tell me
    how to populate the value in my fianl table as 'X'.This is my requirement.How to do???
    In the LOOP on lt_stpox, if lb_recursive is set to X, then populate gs_output-rekri = X for all components for material.
    this is my coading.
    *Panthom item check
       IF  p_phant = c_x .
          DELETE lt_stpox WHERE dumps = c_y.
        ENDIF.
        CLEAR lb_recursive.
        READ TABLE lt_stpox TRANSPORTING NO FIELDS WITH KEY rekri = 'x'.
        IF sy-subrc EQ 0.
          lb_recursive = 'X'.
        ENDIF.
        DELETE lt_stpox WHERE rekri = c_y.
        LOOP AT  lt_stpox INTO ls_stpox.
    *Move header data to final table.
          MOVE-CORRESPONDING ls_topmat TO gs_output.
    *move comonent data to final table.
          MOVE ls_stpox-ojtxp TO gs_output-maktx1.
          MOVE ls_stpox-idnrk TO gs_output-idnrk.
          MOVE ls_stpox-mngko TO gs_output-menge.
          MOVE ls_stpox-rekri TO gs_output-rekri.
          MOVE ls_stpox-meins TO gs_output-meins.
          MOVE ls_stpox-stufe TO gs_output-dglvl.
          APPEND gs_output TO gt_output.
        ENDLOOP.
        CLEAR: gs_output,ls_stpox,ls_topmat.
      ENDLOOP.
    ENDFORM.                    " BUILD_OUTPUT

    Hi,
    As per my understanding of your question, You are checking whether lt_stpox-rekri = 'X'  in below code and then you are setting lb_recursive as 'X' accordingly.
    CLEAR lb_recursive.
    READ TABLE lt_stpox TRANSPORTING NO FIELDS WITH KEY rekri = 'x'.
    IF sy-subrc EQ 0.
    lb_recursive = 'X'.
    ENDIF.
    DELETE lt_stpox WHERE rekri = c_y.
    And after that you are looping at lt_stpox to populate final internal table.
    So, instead of doing this, you can directly loop at table lt_stpox and in loop check if  lt_stpox-rekri = 'X', if yes then gs_output-rekri = X.
    Refer below code.
    LOOP AT lt_stpox INTO ls_stpox.
    If ls_stpox-rekri eq 'X'.
    gs_output-rekri = X.
    Endif.
    *Move header data to final table.
    MOVE-CORRESPONDING ls_topmat TO gs_output.
    *move comonent data to final table.
    MOVE ls_stpox-ojtxp TO gs_output-maktx1.
    MOVE ls_stpox-idnrk TO gs_output-idnrk.
    MOVE ls_stpox-mngko TO gs_output-menge.
    MOVE ls_stpox-rekri TO gs_output-rekri.
    MOVE ls_stpox-meins TO gs_output-meins.
    MOVE ls_stpox-stufe TO gs_output-dglvl.
    APPEND gs_output TO gt_output.
    ENDLOOP.
    CLEAR: gs_output,ls_stpox,ls_topmat.
    ENDLOOP.
    Hope it helps.
    Thanks,
    Archana
    Edited by: Archana Pawar on Feb 1, 2010 11:43 AM

  • Enable / Disable a button Based on a value

    Hi all,
    How can i enable or Disable a Button Based on some input Text value.
    Here is the ADF Code fragment:
    *<af:switcher id="customActionButtons"*
    *facetName="#{actionAvailable.isCustomActionButtons}">*
    *<f:facet name="true">*
    *<af:panelGroupLayout layout="horizontal" id="pgl10">*
    *<af:commandToolbarButton actionListener="#{invokeActionBean.setOperation}"*
    *text="#{wf:getResourceValue('APPROVE', 'bindings.customActions')}"*
    *disabled="#{!bindings.APPROVE.enabled}"*
    *action="#{invokeActionBean.invokeOperation}"*
    *partialSubmit="false"*
    *visible="#{wf:isCustomActionAvailable('APPROVE', 'bindings.customActions')}"*
    *id="ctb2">*
    *<f:attribute name="DC_OPERATION_BINDING"*
    *value="bindings.APPROVE"/>*
    *</af:commandToolbarButton>*
    *<af:inputText value="#{bindings.input.inputValue}"*
    *label="#{bindings.input.hints.label}"*
    *required="#{bindings.input.hints.mandatory}"*
    *columns="#{bindings.input.hints.displayWidth}"*
    *maximumLength="#{bindings.input.hints.precision}"*
    *shortDesc="#{bindings.input.hints.tooltip}"*
    *id="it1">*
    *<f:validator binding="#{bindings.input.validator}"/>*
    *</af:inputText>*
    I have highlighted the Button and Input text in Bold.
    Any suggestions,
    Thanks,
    karthik

    you need to set the autosubmit property for the text field to true. and set the partial trigger for the the button to that input text id.
    and set the rendered property for the button based on the input text value.
    same idea is exist in this link:
    http://groundside.com/blog/GrantRonald.php?title=conditional_rendering_of_jsf_fields_depe&more=1&c=1&tb=1&pb=1
    Edited by: M.Jabr on Feb 7, 2011 1:26 AM

  • Calling report from a button based on parameters

    Hi,
    I want to call a report from a custom button based on some parameters. Suppose
    I have a form based on dept table and I have created a custom button which
    should take the value of the selected deptno and pass as a parameter to the
    report to get all the info from the emp table against that deptno.
    Thanks

    Report:
    You need to create a SQL report with a bind variable. Then you can take a look at the call interface from the "Manage" Screen of your report to find out how to pass parameters to it.
    Form:
    To get the required value from the form, make use of p_session in the Custom PL/SQL handler code, then form the URL of the report and call it using <portal_schema>.wwa_app_module.set_target. Take a look at this post: Problems installing 9iAS 9.0.3

  • Display an exception based on some condition

    HI..
    how to run a exception based on some condition i.e
    i want to highlight the sales(key figure) which r less than the  average sales..
    where sales and average sales r keyfigures...

    Hi!
    welcome to SDN.
    create a calculated key figure which will be 1 if the sales is less then the average sales.
    create exception based on this calculated key figure.
    with regard
    ashwin
    <i>PS n: Assigning point to the helpful answers is the way of saying thanks in SDN.  you can assign points by clicking on the appropriate radio button displayed next to the answers for your question. yellow for 2, green for 6 points(2)and blue for 10 points and to close the question and marked as problem solved. closing the threads which has a solution will help the members to deal with open issues with out wasting time on problems which has a solution and also to the people who encounter the same porblem in future. This is just to give you information as you are a new user.</i>

  • Display menu based on sharepoint user roles

    Hi,
    Could anybody please help me how to display custom navigation menu in sharepoint master page based on user roles
    Eg: supose the loggedin user belongs to approver group then it should display entire menu,
    if logged in user belongs to designer group it should hide some "ui item" (ex: Report)
    Thanks in advance
    Rasna

    Hello,
    If you are using sharepoint server/enterprise then you can also consider audience targetting for the links. You just need to enable publishing feature then set target audience from site action-->site settings-->navigation.
    See this to enable publishing feature:
    http://office.microsoft.com/en-in/sharepoint-server-help/enable-publishing-features-in-sharepoint-2010-HA010378243.aspx
    Hope it could help
    Hemendra: "Yesterday is just a memory,Tomorrow we may never see"
    Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever
    you see a reply being an answer to the question of the thread, click "Mark As Answer
    Please feel free to unmark answer if does not resolves your problem.

  • Hiding buttons based up on business role; Is possible by the BASIS?

    Hi Experts,
    I have done one enhancement for hiding the buttons according to Business role using coding but it was not possible for all the desired buttons since I couldnu2019t find out relevant internal tables for the buttons.
    Now we are planning to do the same activity by the BASIS help.
    Are Hiding buttons based up on user or business role can be possible by the BASIS activity like authorization object to handle the drop downs based up on roles .
    If possible please suggest me the way out to resolve the issue using any kind of BASIS activity.
    Thanks
    Chand

    Hello,
    I do not think that the BASIS can help you in deleting/hiding buttons from the UI. Generally, the buttons are stored in the GT_BUTTON/GT_BUTTONS attribute of the overview view/viewset controller. In some cases it may be hard coded inside the htm page as well in the form of HTML tags.
    We'd definitely need to do some programming to achieve the functionality you are looking for, Also remember it is different for different views. You need to find out the view that has the buttons.
    Do a F2 on your UI screen to find out the details of the screen.
    Regards
    Prasenjit

  • Jsp and jspx and scriplets - Hiding buttons based on J2EE security roles

    Hello:
    I have security a scoped managed bean with methods is Technician(), isUser() etc. In the jsp world, it was very easy to inspect these methods in the jsp via scriplets and show/hide buttons/links etc. I am just curious. Or, is rendering via EL expression the way to go?
    (1) In the jspx world (SRList.jspx in my case), is there an easy way to inspect these managed bean methods and use scriplets to access them and show/hide buttons.
    In the jsp world, I would have written something like
    if (SecurityInfo.isTechnician()
    { %>
    <Button>
    <% } %>
    There would be an import statement to have access to SecurityInfo class in jsp world. I know something is out there in the ADFBC/jspx world. Please advice? If you know of any urls, please let me know.
    (2) Is there a way to grant read/write access to individual pages in my app? I can hide/view buttons based on roles but can't grant update/view access to individual fields on my pages. I know I have to wait for JDEV 11 release to grant permissions via pagedef/iterator as is done in file based security.. Any other solution till then?
    Thanks

    hi useradfbc
    about (1), you could try something like this
    <af:commandButton text="my button for managers" rendered="#{userInfo.manager}"/>(tip : You can use "Your Control Panel" to make your name visible in forum posts.)
    success
    Jan Vervecken

  • How to dynamically add/remove a button from the ribbon based on some condition? (Ribbon XML)

    Hi,
    I have a ribbon (done using ribbon XML) with menu options. I need to remove few buttons from the menu dynamically based on some condition. Also, I want to change the label of another button. How to achieve this programmatically? (C#)
    Thanks in advance.
    Thanks Prasad

    Hello Prasad,
    Use callbacks for populating Ribbon controls such as menu, dropDown, gallery and etc. Then you can use the
    Invalidate or
    InvalidateControl methods of the
    IRibbonUI interface to get your callbacks invoked when required. Thus, you will be able to delete the required item(s).
    You will find the following articles in MSDN helpful:
    Chapter 11: Creating Dynamic Ribbon Customizations (1 of 2)
    Chapter 11: Creating Dynamic Ribbon Customizations (2 of 2)
    To change the label of your controls at runtime you need to use the getLabel callback and call the Invalidate or InvalidateControl methods of the IRibbonUI interface. The following series of articles describe the Fluent UI in depth:
    Customizing the 2007 Office Fluent Ribbon for Developers (Part 1 of 3)
    Customizing the 2007 Office Fluent Ribbon for Developers (Part 2 of 3)
    Customizing the 2007 Office Fluent Ribbon for Developers (Part 3 of 3)

  • Display Image(which set as behind text)   based on some condition.

    hi all
    I have developed a xml report and in that rtf am displaying a static image (which is set as behin text).
    But i need to display the image based on some condition
    for example i have a field as ORG_ID
    if org_id=87 then image should display for that purpose am planning to use <?if:ORG_ID=87?> condition but where to place this condition for the image.
    kindly help me
    thanks for all in advance.

    that too not working because
    on image am displaying some other fields.
    see i think you didn't get my point.
    in my out put page am displaying item details ,quantity,and cost and customer details just like invoice copy .
    behind this data am displaying my company logo which will capture whole page size..
    if i place the image in table then fields will be automatically in table so i cant restrict image in this way.
    Kindly suggest any other way that works only for image which is behind text. i mean condition should be applicable only for image and leaving all other fileds in rtf.
    or
    help on this how to set a dynamic image as behind the text.
    Edited by: maddy on Nov 28, 2012 7:32 AM
    Edited by: maddy on Nov 28, 2012 7:35 AM

  • Display buttons depends on Role

    Hi,
    May I Know how to displaying the buttons depends on user roles. can you give example with code it will helpful to me

    Use EL expressions in <tt>disabled</tt> or <tt>rendered</tt> properties of the corresponding command components. For example, if you want to disable a button if the user is not a member of an ADF Application Role called <tt>Configurator</tt> then you may use code similar to the following:
    <af:commandButton ... disabled="#{!securityContext.userInRole['Configurator']}">or if you do not want to render the button if the user is not a member of the role:
    <af:commandButton ... rendered="#{securityContext.userInRole['Configurator']}">Note, that the specified role must be an ADF Application Role (defined by you using the ADF Security wizard) but not a WebLogic entrerprise group.

  • Display interactive report rows based on user role.

    Hello,
    Can anyone please help me out with this issue. i have an interactive report and now i want to make this report as conditional based on user role. Like i want to dispaly all the report rows for an Admin user role and for a developer I want the report to display only his/her rows. Can anyone please help me how can I resolve this issue.
    Do I need to have two separate reports for each role or can we make achieve this with only one report.
    thanks,
    Orton

    Here is a possible answer.. Build your Interactive report off of a collection. And when you build the collection you can build an if statement to either build your select with or without the filtering of user_id..
    See this blog entry for how to build a interactive report from a collection: http://www.oracleapplicationexpress.com/tutorials/71-oracle-apex-interactive-report-based-on-plsql-function
    Thank you,
    Tony Miller
    Webster, TX

  • Federation, remote role assignment based on ABAP roles on producer

    Hi all,
    We have implemented the federated portal solution for our ESS users. We use the ABAP stack of the producer portal as user store for consumer and have no problems in assigning portal roles on our consumer based on ABAP roles in the backend (displayed as groups in the portal).
    Now we want to add some extra functionality (eg SRM and eRec) and we encounter some problems. These systems all have their own ABAP stack as user store. We have maintained the functional authorization model in the ABAP roles for instance in SRM. So an example:
    System I: ABAP + JAVA --> ECC 6.0
    Here we have the standard R/3 functionality and the producer portal (A) installed. Roles created on producer portal and assigned based on ABAP roles.
    System II: JAVA --> NW 7.0 Portal
    Our consumer portal (B) where we use roles created on the producer portal (A) on System I.
    System III: ABAP + JAVA --> SRM
    Our SRM system with SRM producer portal (C). In the ABAP stack of this sytem the functional SRM roles have been assigned to the users. We have created functional SRM Portal roles in order to use remote role assignment on consumer portal (B).
    +PROBLEM+
    We want to remotely assign portal roles created on the SRM Producer (C) to users on the consumer portal (B), based on the ABAP role assignment in the backend of system III. How can we achieve this in a fast and efficient way?
    Looking forward to your ideas. Anything helpfull will be gladly awarded with SDN points.
    Best regards,
    Jan Laros

    Jan,
    Interesting question. Let me share my experience and hope that's of some use to you.
    We started off federating corporate NetWeaver Portal (lets say B, parallel to your convention) as consumers to BI Portals (Lets say A).
    - B's UME points to Active Directory
    - A's UME points to BI ABAP user store
    - User ids are identical in both systems
    We ran into the problem of dual administration ((de)assigning portal role on both portals instead of just one) for a long time. The issue was because of different reasons at different times as we patched B's and A's. At one point we were on SP15 on both portals and we were told by SAP that RRA can be done on B for remote roles and the assignment propagates to A automatically if the following configuration is set up on both A and B.
    - A's permissions are relaxed allowing "Everyone" group checked for "End User" access as per ([http://help.sap.com/saphelp_nw04s/helpdata/en/43/2236fc0b413fe1e10000000a11466f/content.htm|http://help.sap.com/saphelp_nw04s/helpdata/en/43/2236fc0b413fe1e10000000a11466f/content.htm]
    However, we chose not to do the permission relaxation as enabling "Everyone" group with "End User" access can allow anyone to launch an iView (if the URL is known somehow) and the user would be able to see the layout of the iView, which can include text, etc. The user won't be able to access any data though, however, there is certain compromise on security which we decided that its not okay. So, we digressed in SAP's suggested practice because of security reasons.
    Today we, manage security on B using Active Directory groups and on A using Java groups (ABAP roles).
    In your case, I suggest investigating the option of relaxing the security on producer portal like in the above link. If you think its okay, all you have to do is, provision users on B by assigning remote roles from C and A.
    Either my story is applicable or I must have got you totally wrong,
    Kiran

Maybe you are looking for

  • RMI server calling a method on a client object ?

    Hi All, I am writing a client - server application and my intention is to use RMI for comunication. When the client has to retrive datas from the server it's easy, but let's suppose that the server has to inform the client about some updates about th

  • The operation can't be completed because an unexpected error occurred (error code -8060).

    Hi, I want to copy a folder from desktop to my document (or anywhere else on a MAC) I got this error "The operation can't be completed because an unexpected error occurred (error code -8060)." everytime at the same position when it's about to finish

  • Need Help on Filtering a column

    Hi below is my requirement. ColA ColB ColB In the above, both the column 2 and 3 are the same columns, but i need to filter the column 3 alone based on another column. Please help.

  • When i search on the search bar it also creats a search on my g mail

    when i search in search bar i also get the same search on my gmail acct == This happened == Every time Firefox opened == last week

  • Publish Documents Out of SAP

    Hi We have DMS setup to store documents in a contents server.  Is there a way to get SAP to save the documents to the contents server and at the same time store the on a network drive but only do this when the document is release. I know if sound fun