Is it possible to add a user to a role at run-time?

basically I need to be able to add a user to a role programmatically before the role-based content is displayed to the user.
Example: I have a role called 'Manager' created in the portal. When a user logs on, I detect that the user has the attribute 'job title' = 'Manager' so I add the user to the 'Manager' role and the portal shows the content for the 'Manager' role.

Hi Umesh,
The assigning and unassigning of the users from the roles can be made dynamic using the IRole, IRoleFactory API's. The Blog below explains how users can be assigned or unassigned to a role programatically.
Restricting usage of iViews and Pages
Make some modifications to fit your requirement....
Hope this helps.
Regs,
jaga

Similar Messages

  • Is it possible to load a user defined mathscript function at run-time in an executable?

    I am currently allowing a customer to define their own matlab script for post-processing their data file. This is all well and good in the development environment, beecause when I re-load this VI, it searches my MathScript search paths and re-loads the .m file if it has changed. However I am noticing that when doing a build to an exe the MathScript node seems to be compiled from the file as it is at build time.
    Is there anyway to avoid this? Can I programatically call the MathScript function such that it does the search at run-time? Any ideas would be much appreciated.

    Hey,
    How are you including the .m file? Do you think you could post a screen shot of your code?
    Thanks
    Britton C.
    Applications Engineer
    National Instruments

  • Is it possible to add a user using the RESTful Web Services SDK

    Others have asked before about user management features in the RESTful Web Services SDK.  However I can find no answers or links which provide an answer to the question 'Is it possible to add a user using the BI 4.1 SP2 RESTful Web Services SDK'?
    Any help would be appreciated.
    Regards,
    Steve

    Hi Steve
    Unfortunately, not possible. The BI RESTful can only get "stuff" that is already there. I suppose this would fall under some sort of "Object Creation" API and that is not there. Yet. Rumors abound, but nothing firm. Just as a BTW.; the Business Intelligence platform RESTful Web Service Developer Guide 4.1 is here:
    http://help.sap.com/businessobject/product_guides/sbo41/en/sbo41_bip_rest_ws_en.pdf
    SAP Web Intelligence RESTful web service SDK User Guide, SAP BusinessObjects Business Intelligence platform 4.1
    SAP Crystal Reports RESTful web services - SAP Crystal Reports RESTful web services
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • Is it possible to add a user or license for just one app?

    I have a complete Adobe Creative Cloud license. Is it possible to add a user or license for just one app? What are the monthly costs?

    Cloud Plans https://creative.adobe.com/plans
    -and subscription terms http://www.adobe.com/misc/subscription_terms.html

  • 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

  • I want to write a java program that can add a user to a role or sub role to the Profile Database in iPlanet Portal Server 3.0. Does anyone has any idea or a sample program do such thing. Thanks, Tommy

    I want to write a java program that can add a user to a role or sub role to the Profile Database in iPlanet Portal Server 3.0. Does anyone has any idea or a sample program do such thing? Thanks, Tommy

    // create the user profile, get the handle back,
    // and set the membership profile attributes.
    ProfileAdmin newProfile = null;
    try {
    // the users profile name is the domain      
    // he belongs to plus their userName
    // you will request.domain if your doing this from a servlet, domain_name is the domain_name the user belongs too
    String profileName = domain_name + "/" + user;
         if (debug.messageEnabled()) {
    debug.message("creating profile for " + profileName);
    // create the user profile object
    newProfile = ProfileManager.createProfile(
    getSession(), profileName ,Profile.USER);
    UserProfile userProfile = (UserProfile)newProfile;
         // set the role the user is a member of. Default is to set
         // the users to the default role of the domain they surfed to
         StringBuffer roleName = new StringBuffer(64);
    // request.domain instead of domain_name if your doing this from a servlet ..
    Profile dp = getDomainProfile(domain_name);
    roleName.append(dp.getAttributeString("iwtAuth-defaultRole"));
         if (debug.messageEnabled()) {
    debug.message("setting role for " + user + " = " + roleName);
    userProfile.setRole(roleName.toString());
    newProfile.store(false);
    } catch (ProfileException pe) {
         debug.error("profile exception occured: ",pe);
    return;
    } catch (ProfileException pe) {
         debug.error("login exception occured: ",le);
    return;
    HTH ..

  • Is it possible to add a user in Win NT using Java?

    Hi,
    Is it possible to add a new user to Win NT using Java, assuming that the user running the application is an administrator?
    If it can't be done in Java, can anyone point me in the right direction to research this?
    I appreciate your help.
    Regards,
    Liam.

    Okay, I might have a solution already.
    I'm going to try using JIntegra from www.linar.com as a COM bridge, to access the Win32 API function NetAddUser.
    Regards,
    Liam.

  • How to add iphone user agent in safari browser running on windows xp

    How to add new user agent (iphone user agent) to safari browser(version 3) which is running on windows xp os .
    thanks in advance

    UPDATE:  We were able to further identify the root cause of the problem to be when anonymous access is turned off and the subweb is set up to use basic and integrated authentication (IIS settings).  To test this, we removed integrated authentication (leaving only basic authentication in place) and the problem was fixed.  However, this is not a viable solution as we need to use integrated authentication (for various other reasons).

  • Add an element to the list in run time

    There is an item in my form which is a list of values.It is getting populated based on a record group query.
    I want to let the user enter values at run time and add the values to the exiting list in the form and same
    should be added to the record group so that next time i open the form the added value can be seen.
    Is this possible?
    Regards,

    I have written this code on when_button_pressed trigger to populate the record group RGSTD and LOV(Name LOVSTD).
    I have added the element in the list using add_list_element built in. But it is not giving me proper results.
    Record group has two columns STDID and STDNAME.
    DECLARE
    ln_num NUMBER := 0;
    BEGIN
    ln_num := show_alert('ALERT15');
    IF ln_num = 88 THEN
    add_group_row('RGSTD', 1);
    set_group_char_cell('STDID', 1, 'ST00004');
    set_group_char_cell('STDNAME', 1, 'Add To List');   
    add_list_element('LOVSTD', 1, 'Add To List', 'Add To List');  
    ELSE
    NULL;
    END IF;
    END;Edited by: LostWorld on Feb 9, 2009 5:49 AM

  • Reading from a file. How to ask the user for file name at run time????

    I have the code to read from a file but my problem is how to prompt the user for the file name at run time.
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.util.InputMismatchException;
    import java.util.Scanner;
    public class FileRead {
        public static void main(String args[]) {
            Scanner scan = null;
            File file = new File("Results.txt");
            String number;
            try {
                scan = new Scanner(file);
                while (scan.hasNext()){
                number = scan.next();
                System.out.println(number);}
            catch (FileNotFoundException ex1){
                System.out.println("No such file");
            catch (IllegalStateException ex2){
                System.out.println("Did you close the read by mistake");
            catch (InputMismatchException ex){
                System.out.println("File structure incorrect");
            finally{
                scan.close();}
    }Any hints would be greatly appreciated. Thank you in advance

    I have read through some of the tutorials that you have directed me too and they are very useful, thank you. however there are still a few things that i am not clear about. I am using net beans 5.0 I have placed a text file named Results.txt into the project at the root so the program can view it.
    When I use the code that you provided me with, does it matter where the file is, or will it look through everywhere on the hard drive to find a match?
    This code compiles but at run time it comes up with this error
    run-single:
    java.lang.NoClassDefFoundError: NamedFile
    Exception in thread "main"
    Java Result: 1
    BUILD SUCCESSFUL (total time: 3 seconds)
    import java.util.Scanner;
    import java.io.*;
    class NamedFileInput
      public static void main (String[] args) throws IOException
        int num, square;   
        // this Scanner is used to read what the user enters
        Scanner user = new Scanner( System.in );
        String  fileName;
        System.out.print("File Name: ");
        fileName = user.nextLine().trim();
        File file = new File( fileName );     // create a File object
        // this Scanner is used to read from the file
        Scanner scan = new Scanner( file );     
        while( scan.hasNextInt() )   // is there more data to process?
          num = scan.nextInt();
          square = num * num ;     
          System.out.println("The square of " + num + " is " + square);
    }his is the code that i used. It is the same as the code you posted for me (on chapter 23 I/O using Scanner and PrintStream) Sorry im just really stuck on this!!

  • Is it possible to choose the serial port if only the run time engine is installed

    I have an application, which communicates over the serial port. When I use the full version of Labview I can change the serial port without any problem from Com1 to Com2 (similar to the example “Hardeware input output -> serial -> Labview serial vi"). When I build an application and try to run this program on a computer where only the run time engine 6.1 is installed, it is not possible to choose the serial port. Since there is no “Measurement and Automation Explorer” available on the run time engine and no directory C:\VXIpnp is created, when the run time engine is installed, I do not see a way, how I can satisfy the computer with the information it needs for configuring
    the different ports. Any suggestions?

    Hi Daniel,
    Before LV6.1 there was LV5.1 In LV5.1 the way to Spedify a resource was to use a string control with correct VIsa Resource Class identifier. For eg. "GPIB0::11" or "ASRL1::INSTR". With Introduction of VISA Resource Name Control and linking with MAX, These names are Available from Pull Down List and Can be Aliased, meaning ASRL1 which is Serial Port 1 can be called COM1 and so on. However the old method still works with all 6.1 Controls. Only thing is you have to make sure you Dont Conflict the Class Names ie Use "GPIB::.." instead of "ASRL..." when addressing Serial Port VI's.
    To solve your Problem I would Build a Menu ring with COM1 to COM4 in the Pull Down List.
    Next, If I use the Traditonal Serial Port VI wich accepts the Integer as Seria
    l Port #. I just Wire the Menu Ring to this VI.(Remember COM1 is 0, COM2 is 1 for this VI)
    If I use VISA Config Serial Post. I build an Array Constant with Corresponding VISA Class Names So in our case a String Array Constant of 4 elements "ASRL1::INST" to "ASRL4::INST". I Use Index Array Function With the Index Wired to my Menu Ring. The Array Input Terminal Wired to the Array Constant. The Output of this Array will be correct Visa Class Name Based on slection of my Menu Ring. I can Wire this as Input to my VISA Config Serial Port Vi.
    I have attached a Small VI to Illustrate this.
    Drawback: You must Predefine what Ports you will Want to Use. Basically you define all the cases.
    I hope this Answers your Q!
    Good Luck
    Mache
    Good Luck!
    Mache
    Attachments:
    Serial_Port_Select.vi ‏36 KB

  • Optimal way to enable user to pick style at run time - Flex

    What I'm trying to do: allow a user to be able to select a color palette for a custom component by selecting from a drop down menu with a variety of icons.
    I have the drop down menu part down, but I'm trying to understand how to best handle the various styles in my code. Ideally I would have liked to be able to load styles at run time, but I don't see a major advantage with this so I'm now thinking about compiling in all styles. Still, I can't seem to find a decent way to structure the code. Hacking it seems pretty easy / fast, but there's got a better way than having a big fat array of values which can be indexed via some index associated with each icon - yuck!
    Would love to hear your thoughts or see any pointers to obvious ways to handle this.
    thank you!

    Wouldn't style sheets make this a lot easier where the user essentially just picks one?

  • Possible to add a user that is just iChat?

    Is is possible to setup an account in the system whose only purpose is to be an iChat client? Or should I just make a user and restrict its access to iChat?

    Hi again
    The ichat server requires an entry in the directory for validation of password, services, etc. You need to make a users and restrict them to iChat services only.
    Tim

  • How can i add and delete node in tree in run time

    i want to know the method that let me select tree node to delete it and another to input upon user inputs

    Hello,
    why don't you just enter "add tree node" in the Search Forum search box ?
    There are plenty of samples.
    Francois

  • Is it possible to change the visibility of a inputText in run-time?

    Supposed my jsp has a radio-group with two radio buttons called "visible" and "invisible" and an iputText component. What I want is: at the beginning the inputText is visible and enable. If I click the "invisible" this inputText will changed to invisible and disable. And if I click the "visible" this inputText can be seen and enable again.
    Can I do this with JSF or just with java script?

    To enlarge on what rlubke has been saying.
    <h:outputLabel rendered="#{! loginBean.loggingOut}"  style=" color:rgb(198,0,0);" value="#{i18nBean['USER.VMP010.ITEM6']}" styleClass="PageTitle"/>See how the rendered attribute is deriving it's value from a bound boolean expression. The expression "loginBean.loggingOut" evaluates to a method-call "loginBean.isLoggingOut()" which should return true or false. The "!" operator can be used in much the same way as you use it in Java.

Maybe you are looking for

  • File MSVCR80.dll

    I bought an iPhone 5S but I'm unable to install iTunes because my computer says that the file MSVCR80.dll is missing. I already went to the Microsoft website to try to install this program. It appears that I have now downloaded the program but iTunes

  • SELECT Fails for a WITHIN clause if the xml element have a DASH

    I am using a context index on a CLOB Column and one of my records is like this. ?xml version="1.0" encoding="UTF-8" standalone="yes"?> <cid-spf xmlns="java:com.verid.ident"> <tran-id>1020022445889</tran-id> <tran-time>1187984936000</tran-time> <mode>

  • Itunes cannot communicate with my iphone

    I installed an update and then I tried to restore and i received a message that my iphone (4s) cannot communicate with itunes. (on mac) Any suggestions?

  • I dont have a credit card to register in itunes store what should i do?

    I dont have a credit card to register in itunes store what should i do? there is no NONE option when selecting the credit card so i cannot download any app on my itouch

  • ALE Enchancements

    Hi Friends, I am new to ALE. I want to know what is ALE and how we can implement enchancements in ALE. What may be issues that lead to enchancements. Please help me as much as you can.