Friday, August 16, 2019

How to Assign and Revoke Role/Responsibility to a User using a Standard API? (Doc ID 373369.1)

APPLIES TO:

Oracle Application Object Library - Version 11.5.10.2 to 12.2 [Release 11.5 to 12.2]
Oracle User Management - Version 11.5.10.2 to 12.2 [Release 11.5 to 12.2]
Information in this document applies to any platform.
Checked for relevance on 26-August-2016


GOAL

Using a Standard API to Assign and Revoke Role/Responsibilities to a User

SOLUTION

1. Assign role to a user using an API

To assign role to a user using APIs, use the following API wf_local_synch.PropagateUserRole.
Example:
Begin
wf_local_synch.PropagateUserRole(
     p_user_name => '&USER_NAME',
     p_role_name => '&ROLE_KEY');
commit;
end;

2. Add a responsibility to a user using API fnd_user_resp_groups_api.Insert_Assignment

To add a responsibility to a user using and API, use the following API fnd_user_resp_groups_api.Insert_Assignment:
Example:
 begin
fnd_user_resp_groups_api.Insert_Assignment (
   user_id =>&USER_ID ,
   responsibility_id => &RESP_ID,
   responsibility_application_id =>$APPL_ID ,
   start_date => &START_DATE,
   end_date => &END_DATE,
   description =>'Sample
   example' );
commit;
end; 

This shall raise an error if the responsibility is assigned to a user, but if needed to update the responsibility assignment in case of responsibility existence, use the following API:
begin
fnd_user_pkg.addresp(
     '&User_Name',
     '&Responsablity_Application_Short_Name',
     '&Responsibility_Key',
     '&Security_Group',
     '&Description',
     '&Start_Date',
     '&End_Date' );
commit;
end;

3. Revoke a responsibility assignment to a user using fnd_user_pkg.delresp

To revoke a responsibility assignment to a user using an API, use fnd_user_pkg.delresp.
Example:
Begin
fnd_user_pkg.delresp(         
     '&User_Name',
      '&Responsibility_application_short_name',
      '&Responsibility_Key',
      '&Security_Group');
commit;
End;
 This simply end date the responsibility assignment to a user by the current system date.

4. Revoke an Indirect Responsibility

To revoke an indirect responsiblity (roles assigned using UMX) assignment to a user using APIs, use the following API Wf_local_synch.PropagateUserRole.
Example:
Begin
Wf_local_synch.PropagateUserRole(
       p_user_name => '&USER_NAME',
       p_role_name => '&ROLE_KEY',
       p_start_date=>'&Start_Date',
       p_expiration_date=>'&End_Date');
commit;
End;
End date the parent Role and it shall end date the remaining Roles.

Diagnostics and Utilities Community


Diagnostics
For the latest diagnostics, please reference Document 421245.1 E-Business Suite Diagnostics References for R12.


Utilities Community
Visit the Utilities community for help from industry experts or to share knowledge.

No comments:

Post a Comment

Database Options/Management Packs Usage Reporting for Oracle Databases 11.2 and later (Doc ID 1317265.1)

  Database Options/Management Packs Usage Report You can determine whether an option is currently in use in a database by running options_pa...