Author Topic: SAP Role Authorized Execution in Liquid UI  (Read 6769 times)

Rahul Gera

  • GuiXT Forum
  • Newbie
  • *
  • Posts: 88
    • View Profile
SAP Role Authorized Execution in Liquid UI
« on: February 23, 2017, 11:47:10 AM »
/* *******************************************************************
Function: getAuthorizations
Parameters:

Purpose: Calls function to read user SAP Role
******************************************************************* */

function getAuthorizations(){
   call('BAPI_USER_GET_DETAIL', {"in.USERNAME":"&V[_user]","table.ACTIVITYGROUPS":"Z_ROLES"});
}

/* *******************************************************************
Function: roleExists
Parameters:
   roleName
Purpose: Checks to see if current user has the roleName match
******************************************************************* */

function roleExists(roleName){
   for (ii = 0; ii < Z_ROLES.length; ii++)   {
      var z_userrole = Z_ROLES[ii].toString().substring(0,30).trim();
      if(z_userrole == roleName) {
         return true;
      }
   }
   return false;
}