How to set role to a resource (portal, portlet..)

Hi everybody,
I have a resource's name and I want to set an role entitlement to a resource (portal, portlet, book...) but I don't know how to do this by programming.
Please help me. Thanks

I can get all the roles entitled to a resource by programming as follows:
String delimiter = EntitlementConstants.RESOURCE_ID_DELIMITER;
String resourceID = "com_bea_p13n"+ delimiter +
                    "Portlet"+ delimiter
                    +"showProfile";          
String[] roles = RolePolicyManager.listRolesForResource(ApplicationHelper.getNonVersionedAppName(),                    ApplicationHelper.getWebAppName(getRequest()), resourceID);     
This code will return all the roles entitled to the portlet 'showProfile'.
So I think, it is possible to set a role to a resource by programming, but I don't know how to do this.
Anyone have an answer?
Edited by: user11732508 on Jul 27, 2009 12:11 AM

Similar Messages

  • How to set role based Authorization in JAAS

    how to set role based Authorization in JAAS
    i had user name , password and role in FileLogin
    thanks
    arun .v.

    http://dev2dev.bea.com/pub/a/2003/04/Kemp_Helton.html?page=last

  • How to Set up PRT (Production Resource Tool)

    Hi ,
    Anyone knows How to Set up PRT (Production Resource Tool)  for equipment , is it all master data set up or there any configuration required to activate PRT .
    Thanks
    Pawan

    just in case have a quick look here:
    http://help.sap.com/saphelp_47x200/helpdata/en/89/a42719461e11d182b50000e829fbfe/frameset.htm
    Logistics - Production Process - Master Data - Production Resources/Tools - Production Resources/Tools - Equipment - Create.
    spro->production planning for process industries->master data->production resources/tools (PRT)
    you will see 5 transactions to configure your settings:
    -define PRT auth.grps
    -define PRT status
    -define Task List Usages
    -define PRT Group Keys
    -Define Overview Variant for Where-Used List/Mass Replacement

  • How to set the view privilege of a portlet?

    Dear all,
    I would like to ask how to set the view privilege of a portlet (which is located on the Intranet homepage) to only a group of users?
    As far as I know, I can create a tab with view privilege to address the about scenario. But is it possible to directly set the view privilege to the portlet ?
    thanks
    George (HK)
    Welcome to my photo albums at http://community.webshots.com/user/GeorgeLee80
    Message was edited by:
    georgelkh

    OK, you got me there George. I don't know where you can set view rights to an out of box portlet. So how about a different approach?
    1) Create a blank page with no nav bar or anything else
    2) Assign the group you want to see the notifications portlet view rights on the page
    3) Make sure the show as portlet check box is checked on the Optional tab in the page properties
    4) Add the notifications portlet to the page
    5) Ensure the portlet settings are how you desire in terms of what notifications to show and the region settings are how they should be in terms of border, headers, etc
    6) Edit the page where you want the notifications portlet to be shown and add the page portlet you just created instead of the notification portlet
    This should achieve what you seek without having to dig into out-of-box portlets.
    Rgds/Mark M.

  • How to set role which can issue only one command

    I am thinking about setting role, which will be allowed to issue olny one command. I have created role test. Which has the following entries in the following files:
    /etc/user_attr
    test::::profiles=OneCommand;type=role
    /etc/security/exec_attr
    OneCommand:solaris:cmd:::/tmp/data.sh:euid=0
    After this I sill could issue all comands, not only test command /tmp/data.sh.
    When I issued comand profiles on test role I received the following:
    bash-3.00$ profiles test
    OneCommand
    Basic Solaris User
    All
    So I commented line in the /etc/policy.conf to read:
    #PROFS_GRANTED=Basic Solaris User
    After that, when I try to issue /tmp/data.sh command as a test role I receive the following error:
    $ /tmp/data.sh
    pfexec: Exec format error
    Does anybody know how to set up the role which can issue only one command ? Maybe there is a way to do this in the way which wil not affect another roles (ie, not to touch /etc/policy.conf).
    Best regards

    RadekW wrote:
    I am thinking about setting role, which will be allowed to issue olny one command. I have created role test. Which has the following entries in the following files:They will need the ability to run at least a profile shell otherwise all bets are off. So now you're down to two commands. :-)
    bash-3.00$ profiles test
    OneCommand
    Basic Solaris User
    AllFirst you need to define what already exists by default. (policy.conf)
    Then you get to change those defaults or create a new default list just for test.
    Then you get to add a role or profile for test that allows the execution of a profile shell and one command.
    Then you should test all of the user accounts to ensure that something didn't break. This step might be a little overkill.
    alan

  • How to set up SSO between e-portal employee node & ebill customer node?

    We have a requirement to set up SSO between e-portal employee node & ebill customer node.
    I am told that sso is possible only between 2 employee nodes.
    Please advise.

    Not sure I understand which part is failing.
    Is it the C program calling your packaged function? Or does the error occur in the PL/SQL code, in which case you should be able to pinpoint where it's wrong?
    A few comments :
    1) Using DOM to build XML out of relational data? What for? Use SQL/XML functions.
    2) Giving sample data is usually great, but it's not useful here since we can't run your code. We're missing the base tables.
    3) This is wrong :
    vStrSqlQuery := 'SELECT * FROM ' || vTblName                     || ' WHERE record_update_tms <= TO_DATE(''' || TO_CHAR(vLastPubTms, 'MM/DD/YYYY HH24:MI:SS') || ''', ''MM/DD/YYYY HH24:MI:SS'') ' ;
    A bind variable should be used here for the date.
    4) This is wrong :
    elmt_value := xmldom.createTextNode (doc, l_clob(1));
    createTextNode does not support CLOB so it will fail as soon as the CLOB you're trying to pass exceeds 32k.
    Maybe that's the problem you're referring to?
    5) This is most wrong :
         l_clob(1):=REPLACE(l_clob(1),'&lt;?xml version=&quot;1.0&quot;?&gt;', NULL); 
         l_clob(1):=REPLACE(l_clob(1),'&lt;', '<'); 
         l_clob(1):=REPLACE(l_clob(1),'&gt;', '>'); 
    I understand what you're trying to do but it's not the correct way.
    You're trying to convert a text() node representing XML in escaped form back to XML content.
    The problem is that there are other things to take care of besides just '&lt;' and '&gt;'.
    If you want to insert an XML node into an existing document, treat that as an XML node, not as a string.
    Anyway,
    Anyone that can help me to find out the required magic number
    That would be a bad idea. Fix what needs to be fixed.
    And please clearly state which part is failing : the C program or the PL/SQL code?
    I'd vote for PL/SQL, as pointed out in [4].

  • How to set roles from JDBC connections

    Hi guys,
    I have a jdbc connection which purpose is to run queries based on a string that I construct in my program.
    My question is: if I have to run a DCL, like: SET ROLE RL_XXX TO USER1;
    What's the easiest way to do it with my same connection?
    Thanks.

    Hi Marc,
    Sorry for the typo. It's a BDC source, I use a WCF client to access a SQL Database (HR External System) that has 4 fields that are necessary to present in the Sharepoint User Profile. The issue occurs with a Full or a Delta Sync. The problem is that if the
    BDC source is not present the fields are deleted (I get a SPS-Dummy Added and all of the pbjects in the BDC Connector Space are deleted).
    I do not want this to happen. I do not want the User Profile Attributes/Fields to be empty/deleted if there is no connection I simply want them to stay what they are... I have two issues.
    1) Is that the even if i change my data on SQL Server side, the changes do not get picked up by the sync. Since the only field that is being tested for change is an ADid, since the id does not change the BDC does not consider them changes.
    2) If there is no connection I do not want the attributes to be deleted. I have not figured out a way to effectively do this.
    So my issue appears to be simple to solve, but after 4 days and hundreds of tutorial pages read I have yet to figure out a proper way to do this.
    Here is the pseudo-specification
    The Fields that come form the HR System (SQL Server) are to be presented in the user profile. If there is no connection to the BDC file the fields remain as they are until there is a connection and updates can be made. Changes to any of the fields are performed
    manually in the HR system. These changes must be picked up by the daily sync.

  • How to set property for KM Resource in webdynpro Java

    Hi all
    i am trying to set the property for KM resource in webdynpro for java.
    can anybody send sample code, then it will be great help to us?
    Regards
    Sunil

    Hi Sunil,
    check in sdn with thread name as
    "Reading property from a resource via api, tricky one"
    Koti Reddy

  • How to set the contentType for JSF Content Portlet.

    Hi,
    When I tried to get the data from data base and construct a downloadable .csv appending the html at the end of the actual csv content. Please find the below given code for reference.
    JSP Code :
    <f:view>
    <h:form id = "test">
              <h:commandButton immediate="true" value = "Download CSV" actionListener="#{myManagedBean.downloadCSV}">
              </h:commandButton>
    </h:form>
    </f:view>
    Managed Bean method (Listener Method):
         public void downloadCSV(ActionEvent event) {
              FacesContext.getCurrentInstance().responseComplete();
              OutputStream os = null;
              try {
                   HttpServletResponse response = (HttpServletResponse) FacesContext
                             .getCurrentInstance().getExternalContext().getResponse();
                   response.setHeader("Content-Disposition","attachment;filename=report.csv");
                   response.setContentType("application/download");
                   os = response.getOutputStream();
                   StringBuffer buffer = new StringBuffer();
                   //following code has to be replaced by records retrieved from database.
                   for (int i = 0; i < 1000; i++) {
                        for (int j = 0; j < 100; j++) {
                             if (j == 0) {
                                  buffer.append("Test " + j);
                             } else {
                                  buffer.append(",").append("Test " + j);
                        buffer.append("\n");
                   System.out.println("Get Content Type :==>"+response.getContentType()); // always returning text/html;
                   os.write(buffer.toString().getBytes());
              } catch (Exception e) {
                   e.printStackTrace();
              } finally {
                   if(os != null){
                        try {
                             os.close();
                        } catch (IOException e) {
                             // TODO Auto-generated catch block
                             e.printStackTrace();
    The above given code is appending the html content at the end of the actual content. I noticed one thing, even though I am setting the content type to application/download (or) text/csv when i am printing the content type it is always returning "text/html".
    Thanks.

    Hello,
    The portal will not allow you to change the content-type of a single portlet's response. Since each portlet is rendered onto a single HTML page along with other portlets, the content-type of the whole page (and therefore of each portlet) must be HTML-- you can't have a different content-type for just a portion of the page.
    This means that you cannot render non-HTML content for a portlet within the portal framework. However, you can render non-HTML content as a separate "resource" outside of the portal context- for example, if you create a resource URL in your portlet that points at a servlet, the servlet can serve up any content-type you wish.
    The JSR329 JSF portlet bridge (and the JSR286 portlet specification it is based on) even have a special "portlet-served resource" mechanism that allows you to serve non-HTML content while still having access to all of the portal context (all of your portlet state). From the code you posted, it looks like you are not using the JSR329 portlet bridge, but you might want to take a look at it.
    Kevin

  • How to set selected Language from Portal dropdown in Logon to User profile

    Hi Gurus,
    I select a language in Portal Language dropdown in the Logon Page.
    After login in the content is getting displayed in the browser language.
    I want the portal content to be displayed in the selected language in the portal LogonPage.
    I checked the thread Logon page change to add a dropdown for language
    The is the requirement for me too .
    Kindly suggest me on how to set the language in the Portal user Profile so that the portal contents gets displayed in the selected languages from the dropdown .
    Thanks in Advance

    Hi Prasanna,
    The language that the portal is displayed in depends on the following
    heirarchy, with the languages at the top of the list taking precedence
    over those at the bottom:
    1. Component (iview) language (defined in the portalapp.xml)
    2. Portal Mandatory language (defined in the prtDefault.properties)
    3. User language (defined in the user#s profile).
    4. Request language (defined by the browser).
    5. Portal Default language (defined in the prtDefault.properties)
    6. System Default language (default locale defined by the OS).
    So for example, if you have your portal user language (as in point 3)
    set to Russian, but the language of the iView that is the logon page
    (as in point 1) set to English, that logon page will be displayed in
    English.
    Keeping the above in mind, please make the necessary changes to the
    configurations and check if it helps.
    Regards,
    Sowmya
    Edited by: Sowmya K on Jun 2, 2011 11:32 AM

  • How to set "Make this group privileged" property for group?

    There is a group property which is
    shown as a checkbox in OID Console and
    described as "Make this group privileged. Enabling this option will allow you to perform the assignment of privileges to this group. Non privileged group cannot be associated with any privilege.".
    How to set this property programmatically using Portal PL/SQL API ?
    Thanks

    nina91x,
    It sounds like you have two elements for each crane and forklift service, namely, a labor component that perhaps prepares, delivers, services, etc. each piece of machinery and a material element which is the machine itself. You could create labor and materials
    resources to correspond to each of those elements, but Project doesn't allow you to set a max on a material resource, so creating a material resource for the cranes and forklifts probably isn't going to work.
    What you really need, at least as I interpret it, is a combination schedule (to track your labor) and a spreadsheet (to track your machines). I suggest you only list the labor elements as performance tasks in your schedule. For example, under the Support
    summary line, you might have separate tasks for, Service cranes, Prepare cranes for delivery, Deliver cranes, Retrieve cranes, and likewise for the forklifts. Then, instead of creating or assigning the machines as a resource, customize a couple of extra fields
    (e.g. Text1 and Text2) to track the number of machines that are used and available. For example, if the Text1 field is renamed "Cranes/Forklifts Used", you could enter into that field the number the customer currently has at his jobsite. I would
    enter that value in the Text1 field for the Deliver cranes task. The labor for that task is the truck drivers time to make deleveries and it would be tracked as any normal labor task. Rename the Text2 field as "Cranes/Forklifts Available" and customize
    that field with the formula: IIF([Text1]>"0","250"-[Text1],""). As data is entered into the Text1 field, the Text2 field will automatically calculate the remaining inventory. See the screenshot below.
    Using the above structure you will be tracking both labor and machines and the machine usage will have no impact on progress.
    Hope this helps.
    John

  • Setting VMware vCenter Computing Resources from command line

    Does anyone know how to set VMware vCenter Computing Resources from the command line? vda pool-setprops doesn't seem to include an option for it. Thanks.

    This document was posted in Aug 23, 2012. It covers Mountain Lion but Lion server may be similar.
    http://support.apple.com/kb/HT5359
    OS X Server (Mountain Lion)-based servers that need to run high performance services can use the command line utility serverinfo to dedicate systems resources.
    serverinfo --perfmode
    Gets the current mode
    serverinfo --setperfmode 1
    Sets the high performance mode
    serverinfo --setperfmode 0
    Disables the high performance mode.
    Note: Transitioning to or from high performance mode requires a restart.

  • How to set a variable in portal session using web dynpro java.

    Hi,
    I have created a web dynpro application, which is running inside portal. I have created a role called "R1". Inside role R1, i have created 3 workset W1, W2 and W3. and inside each workset i have some pages and iviews.
    My requirement is when user logins to the portal , and when he clicks on role R1 for the first time, a login page should come (so that we can do revalidation), and when he enters his password again in that login page , then only workset W1, W2 and W3 should be visible/accessible to him and after successful revalidation, if he clicks again on role R1, in that particular portal session, than that login page should not come.
    for this, i thought i will set a variable in portal session, whenever user successfully revalidated himself, and if after successful revalidation he clicks again on role R1, i will check in doinit method of webdynpro whether variable is set or not (which i already set on successful revalidation), and if it is set then i will do Donavigation else i will present login page to the user.
    Can anyone tells me how to set a variable in portal session using web dynpro java.
    thanks
    Arush

    Hi,
    Try this:
    WDScopeUtil.put(WDScopeType.CLIENTSESSION_SCOPE, key, value)
    WDScopeUtil.get(WDScopeType.CLIENTSESSION_SCOPE, key)
    Ex:
    WDScopeUtil.put(WDScopeType.CLIENTSESSION_SCOPE,"Key1","Value1");
    String value1=WDScopeUtil.get(WDScopeType.CLIENTSESSION_SCOPE,"Key1").toString();
    /people/william.cui/blog/2007/02/12/sharing-session-context-between-parent-and-external-windows-running-on-same-host
    Regards,
    Charan

  • How can i set an image to a portal

    how can i set an image to a portal using response.write();
    please guide me i have an image in C drive how to get the image

    Hello,
    you can use the HTML Tag:
    <img src="file://c:/path/image.jpg" />
    Regards
    Gregor

  • How to set a default value for particular field in SRM PO Portal

    Dear Gurus,
    Im desparetly need a help in web dynpro on how to set a default value for a field(flag) in PO header tab in portal.
    My requirement is whenever the user press the edit button in PO screen,automatically a flag field should be set as abap_false.
    I dont think this will handle in check badi or change badi. i tried this part in onbuttonpressed overwriteexit in CNR_VIEW views,i can get the function EDIT in debugging mode,but dont know how to proceed further.....
    Many of them suggested to go with get attribute and set attribute for changing any particular field in web dynpro,but im not very familiar in using those get and set attributes.I request you people can give me sample code on how to identify my target field in the node and set the values while pressing EDIT Button.
    Thanks in advance...
    Regards,
    Sathish

    Dear Laurent,
    Thanks for your response,
    But i searched in enhancement spot of WD_BADI, but couldnt get the exact way to change the coding,
    My real requirement is, that particular flag should be enable and disable dynamically by checking a condition in my header values.So in that case i dont know how to proceed further to handle in the PO screen.
    Kinly guide me how to get the particular node of field in the Purchase order screen.
    Thanks you in advance,
    Sorry for the inconvenience if any
    Regards,
    sathish

Maybe you are looking for

  • Cannot view Keynote slides except in slideshow or slide navigator

    I'm using Keynote '09 version 5.0.3 (791) on Macbook Pro Intel Core 2 Duo with OS X 10.6.3. Been working fine ... always. Today I installed the latest Apple update and ... bad times. Firstly, many of my settings (screensaver, desktop, etc.) have chan

  • Hide Exit Command Button

    Hi! Does anyone know how to hide the exit command button in the nokia series 80 which is automatically inserted by itself? I need to hide the exit command button because if the user select the default button, my application is still running at the ba

  • Change job owner for job owned by a report server process

    Question on a SQL 2008 Enterprise Edition (64-bit) I have changed the owner of a couple of jobs (owned by a report server process) using Management Studio. The new user has sysadmin role just like the previous one had. Then I kept thinking on the job

  • Audio stops playing on page change if horizontal sliding only is checked.

    Audio stops playing on page change if horizontal sliding only is checked. But it works when it is unchecked (InDesign CC)  I would like it works in both cases. Is it possible ? I know it was not possible a few months ago... Have another question : au

  • GoLive cs2-double click to enlarge image

    Hello, I would to know the correct way to shrink my photo to fit my design in GoLive cs2. Then once launched, when you double click the photo/image it enlarges to view a larger image. I have done it in the past and I am just missing a step. Thanks