How to add a participant to a role programmatically

Since Fuego.Lib.Role.addParticipant API method has been deprecated, how can I add a participant to a role at runtime?
Thanks.

Hi I tried the same thing and it's not working at all.
My code:
dirHumanParticipant =
DirHumanParticipant.fetch(session : session, id : approversGroup.apprID);
if(null == dirHumanParticipant) {
logMessage("create user.");
dirHumanParticipant = DirHumanParticipant.create(session : session,
id : approversGroup[i].apprID, firstName : approversGroup[i].apprFName,
lastName : approversGroup[i].apprLName, displayName : approversGroup[i].apprLName +
", " + approversGroup[i].apprFName, mail : approversGroup[i].apprEMail, telephone : "",
fax : "", password : "1", ou : ou, rolesAssignment : roleAss, enabled : true);
} else {
logMessage("user already exist. Assigning the new role.");
tmproleAss = dirHumanParticipant.rolesAssignment;
generalUserRole = Activity.role.find(name : "General User");
for (int j =0; j < generalUserRole.participants.length(); j++) {
generalUserID = generalUserRole.participants[j].id;
if (generalUserID == approversGroup[i].apprID) {
logMessage("General User Matches");
isGeneralUser = true;
break;
approverRole = Activity.role.find(name : "Approver");
for (int k =0; k < approverRole.participants.length(); k++) {
approverID = approverRole.participants[k].id;
if (approverID == approversGroup[i].apprID) {
logMessage("Approver Matches");
isApprover = true;
break;
if (isApprover) {
logMessage("user has Approver Role. Assigning General User Role");
tmproleAss.insert(@int : tmproleAss.length(), value : RoleAssignment.create(
role : role1, permissions : 95));
} else if (isGeneralUser) {
logMessage("user has General User Role. Assigning Approver Role");
tmproleAss.insert(@int : tmproleAss.length(), value : RoleAssignment.create(
role : role, permissions : 95));
dirHumanParticipant.setRolesAssignment(tmproleAss);
dirHumanParticipant.update();
approverRole1 = Activity.role.find(name : "Approver");
for (int l =0; l < approverRole1.participants.length(); l++) {
approverID1 = approverRole1.participants[l].id;
//if (approverID == approversGroup[i].apprID) {
logMessage("Approver IDS1:" + approverID1);
//isApprover = true;
//break;
Any Help would be appreciated.
Thank You!
Kannan R.

Similar Messages

  • 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

  • How to add web template to a role

    Hi experts,
       I have to add a webtemplate to a role, how can i do it i mean which option i have to select in PFCG.
    Regards
    Prasad

    Hi Prasad,
    If you want to display the role after executing the template then suerly you need to add it the properties of the wen item menu role.
    Else it will not be displayed after execution.
    If it is for testing purpose you can test and remove it again.
    You can add in the wen template when you give it to your users .
    Regards
    M.A

  • How to add the Self-Service Administrator role...please guide

    Hello All,
    Am new in ESS/MSS. Have just uploaded the ESS/MSS business package on EP6 SP15.
    Now as per the notes given on help.sap.com site on Floor Plan Manager, I need to addin a Self-Service Administrator role to use FPM.
    Where can I find this......
    Please guide.....
    Awaiting Reply.
    Thanks & Warm Regards,
    Ritu

    Hello All,
    Am working on <b>EP 6 SP15 Sneak Preview</b>.
    I need to customise Web Dynpro components of MSS...namely PCR, using Web Dynpro for Java.
    Am in the process of reading the Floor Plan Manager concept from help.sap.com site...
    Have 2 queries now:
    1. If I use Self-Service Administrator, the business packages I need are :
    - Business Package for Self Service Administraor
    - Business Package for Common Parts....
    but these both are for NW2004s...am using NW2004. I did not find any such pacges for NW2004....
    Any inputs?
    2. link http://help.sap.com/saphelp_erp2005/helpdata/en/b4/139525380149a49c8402e22700e4ba/frameset.htm says that:
    Implicitly, by creating a configuration component that implements the interface IXSSAppConf. This is the only possibility for self-service applications in SAP ERP 2004 and above.
    Now I need to update the UI of PCR, so how can I do it...any hints....
    Please guide....
    Awaiting Reply.
    Thanks & Warm Regards,
    Ritu

  • How to add external user to the group programmatically in SharePoint?

    Hi all,
    I want add an external user to a sharepoint group:
    When I run the below code in ConsoleApplication the user will be added to the DemoGroup,
    but when I add my code to User Control and run the code on SharePoint it doesnt work and I get an error:
    The user does not exist or is not unique.<nativehr>0x81020054</nativehr><nativestack></nativestack>
    Now I change the code:
    SPUser user = spWeb.EnsureUser(userName);
    I get again an error:
    The Specified user i:0#.f|IT2S|Doe, John was not found.
    string extName = "Doe, John";
    string domainName = System.Environment.UserDomainName;
    // in sp this is way how we get the domain:
    //string domainName = System.Environment.GetEnvironmentVariables()["USERDOMAIN"].ToString();
    web.AllowUnsafeUpdates = true;
    string userName = string.Format("i:0#.f|{0}|{1}", domainName, extName);
    web.SiteUsers.Add(userName,"[email protected]", extName, "0222");
    SPUser user = web.SiteUsers[userName];
    if (user != null)
    web.Groups["DemoGroup"].AddUser(user);
    web.Update();
    web.AllowUnsafeUpdates = false;
    can anyone please help me and say why that not work? Or if someone have an idea?
    thank you in advance
    Ahmad
    SP 2013 & SPD 2013 & VS 2013 & MSSQL 2012

    Hi Linda Li,
    yes I solve the issue with FBA:
    http://chrisbarba.com/2013/07/16/sharepoint-2013-forms-based-authentication-fba/
    and
    http://sharepointsolutions.blogspot.de/2012/08/configuring-forms-based-authentication.html
    with above links I solved the task.
    Best Regards
    Ahmad
    SP 2013 & SPD 2013 & VS 2013 & MSSQL 2012

  • How can I Add/Delete Participant?

    Hi,
    I want to add/delete participant in my code.Or can I write a batch to import all of my participant?
    The reason I want to do in this way is that:I an company,all of the employee can use ths system.So one by one to add participant is hardly.
    In fact,I know how to add a participant(DirHumanParticipant.create.......),but when I added a participant,I can't remove the participant.How can I do this?
    Please,help me. Thanks.

    Hi,
    According to your post, my understanding is that you want to add permission policy levels in web application.
    Instead of add the permission levels to the web application, you can lterate all the sites in the web application, then add the permission levels to the sites.
    There is an article about this topic, you can refer to it.
    http://social.technet.microsoft.com/wiki/contents/articles/18661.sharepoint-2010-update-a-permission-level-using-powershell.aspx
    Thanks,
    Jason
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Jason Guo
    TechNet Community Support

  • Can I get the participants of the role of some activity using PAPI?

    Hi all,
    Can I get all participants who have the role of one activity using PAPI? how?
    thanks and regards.

    Hello,
    I have the same problem, how to get the participants of specific role using PAPI ?
    Thanks

  • 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

  • How to add a role so user can do Export, Copy & paste Master Data?

    How to add a role so user can do Export, Copy & paste Master Data? Thanks!

    Add S_GUI to the user role.

  • How to add Administrative Groups(Roles) in 11g

    Hi,
    I am migrating the 9i query to 11g query. In 9i query I saw gpp table join to get the group owners. In 11g I didn't find the Administrative Groups(Roles) tab or section to assign administarive group to the group(Role in 11g). Where we can find this tab, if tab is not avilable then how can we assign the same group(role)? when data will populate into gpp table in 11g? Please guide me on this.
    Thanks
    Kishore T

    hi,
    are you saying you want to add custom Roles to 11G?
    it's either on the Advanced page or the Administration where you can add new custom Roles.
    there is also the RoleManager Service (API) that can add them programatically.

  • How do I add user to a Contact Role in 11i? ( GIS )

    Hi Hussein:
    I was trying to find out how to add a list of users to a contact role in GIS? Initially the contact used to be individual email_id's , but right now the user email_ids are added to a new role and in the subsidiary company setup the contact is having a pointer to the role.
    Regards,
    Bala

    Yes, Hussein.. If you login to EBS as a user with GIS Responsibility --> setup -- > Intercompany -- > Subsidiaries
    in the form u will notice 'Notification Options' and you will see a field ' Contact '. This filed normally used to be a email id. For easy manageability they have created a contact role and assigned users to this role. I do now how to get the list of contact roles and how to add the new users to the role, so they can get notifications.
    Regards,
    Bala

  • How to Add Active Directory user to Admin Role

    Hi All,
    I am trying to figure out how to add a AD user to the Admin Role..
    I am connected to AD and can see the user (myself), however, when I try to add myself to the admin role, it says user not found.
    I go to Security Realms > myreals > Roles and Policies > Global Roles > Roles > Admin > View Role Condition.
    I see that the Administrators Group is already added. Now I click "add Conditions" and select "User" from the Predicate List and type in the user " Doe' John".
    On the next screen I get "user: John or Dow" does not exist.
    Another option could be to add the user to the Administrator group, but I couldnt figure out how to do that as well. When I navigate to the user under Users or Groups, I dont see an option to add that user to the Administrator group.
    Is it that you can only add users created in Weblogic to the Admin group?
    Any help on this will be very appreciated.
    Thanks in advance.

    I think I got it. I had to add the AD group the user is part of to the Admin role.

  • How to add a role to the Portal Favorites

    Hello gurus,
    I have a role to add to the Portal Favorites to avoid drilling down to many levels, does anyone know how to add a role to the Portal Favorites?
    Thanks in advance for your response.
    Regards,
    Niki Nguyen
    Message was edited by:
            Niki Nguyen
    Message was edited by:
            Niki Nguyen

    Niki,
    The documentation says that
    The Portal Favorites iView contains a freely definable list of links for direct access to items that you use regularly. This can include the following:
    &#9679;     Portal pages and iViews that run as full-page applications
    &#9679;     Documents, folders, and other items in KM repositories
    &#9679;     External items, such as Internet pages
    So we can't do it for Roles.
    For detailed information see <a href="http://help.sap.com/saphelp_nw04/helpdata/en/3a/d609e5803111d5992f00508b6b8b11/frameset.htm">Portal Favorites</a>
    Mr.Chowdary

  • CRM2007 How to add a Web Dynpro ABAP application to a CRM business role

    I am investigating CRM2007 UI framework and I cannot seem to find a way to add a custom made Web Dynpro ABAP Application (created in CRM 4.0) to a business role, or how to add a custom transaction created in classic ABAP (transaction created via se93, progam created via se38). Whatever I do, I only see BSP components. I am using transaction BSP_WD_CMPWB.
    Next to this it seems you can add/integrate Visual Composer applications to (there is an entry in spro called "integration of the visual composer in BI"). However, I presume we first have to meet the requirements for the portal integration in SAP CRM 2007 as described in spro. If somebody knows how this works, that would be great!
    kind regards
    Angelique Heutinck

    Hello Angelique,
    It should be possible to call web dynpro applications from the L-shape menu of CRM UI (check transaction CRMC_UI_NBLINKS). As for the old GUI transactions, you can embedd them also via transaction launcher using CRMC_UI_NBLINKS (search for "transaction launcher" in this forum, there is plenty of information on it).
    Best Regards,
    Yevgen
    Edited by: Yevgen Trukhin on Jun 19, 2008 11:53 AM

  • How to add a workbook report (attached to RRMX) to a role

    hi guys,
    i have RRMX workbook . how to add this into a role ?

    Hi,
    Go to work book click on save button and left hand side you will see two options
    1. favourite
    2.role
    click on roll and choose your folder and save it.
    Regards,

Maybe you are looking for