AnsweredAssumed Answered

Add Aveksa entitlements using SQL

Question asked by Dj4bIamQPv7HFSpC1lG08vP2ANE8fvnDUNK3hVdVlsQ= on Jul 4, 2016
Latest reply on Jul 7, 2016 by Venkata Ramana Reddy Kanaparthy

Hi,

 

I want add "Other business owners" to a business unit using SQL. I know that is not recommended but i have not choice cause i need to update the business units automatically (update = add OBO).

 

For that, i add ACLs in T_AV_SECURITY_CONTEXT_USERS

 

INSERT ALL 
    INTO AVUSER.T_AV_SECURITY_CONTEXT_USERS (USER_ID,RESOURCE_NAME,ACTION_NAME) 
    VALUES ((select distinct user_id from AVUSER.T_ENTERPRISE_USERS where 
    CUS_ATTR_USER_CAS_9 = bu_owners),'Rule Set','Business Unit Other Business Owner')
    INTO AVUSER.T_AV_SECURITY_CONTEXT_USERS (USER_ID,RESOURCE_NAME,ACTION_NAME) 
    VALUES ((select distinct user_id from AVUSER.T_ENTERPRISE_USERS where
    CUS_ATTR_USER_CAS_9 = bu_owners),'User','Business Unit Other Business Owner')
    INTO AVUSER.T_AV_SECURITY_CONTEXT_USERS (USER_ID,RESOURCE_NAME,ACTION_NAME) 
    VALUES ((select distinct user_id from AVUSER.T_ENTERPRISE_USERS where
    CUS_ATTR_USER_CAS_9 = bu_owners),'Application','Business Unit Other Business Owner')
    INTO AVUSER.T_AV_SECURITY_CONTEXT_USERS (USER_ID,RESOURCE_NAME,ACTION_NAME) 
    VALUES ((select distinct user_id from AVUSER.T_ENTERPRISE_USERS where 
    CUS_ATTR_USER_CAS_9 = bu_owners),'Data Resource Set','Business Unit Other Business Owner')
    INTO AVUSER.T_AV_SECURITY_CONTEXT_USERS (USER_ID,RESOURCE_NAME,ACTION_NAME) 
    VALUES ((select distinct user_id from AVUSER.T_ENTERPRISE_USERS where 
    CUS_ATTR_USER_CAS_9 = bu_owners),'Directory','Business Unit Other Business Owner')
    INTO AVUSER.T_AV_SECURITY_CONTEXT_USERS (USER_ID,RESOURCE_NAME,ACTION_NAME) 
    VALUES ((select distinct user_id from AVUSER.T_ENTERPRISE_USERS where 
    CUS_ATTR_USER_CAS_9 = bu_owners),'Role Set','Business Unit Other Business Owner')
    select * from .................

 

Then i create an entry in T_AV_SECURITY_VALUES

 

INSERT ALL 
    INTO AVUSER.T_AV_SECURITY_VALUES (REFERENCE_KEY,REFERENCE_ID,ENTITLED_TYPE,ENTITLED_ID)
    VALUES ('BU_OBO' , (select id from AVUSER.T_AV_BUSINESS_UNITS where NAME = bu_name),
    'user', (select distinct MASTER_ENTERPRISE_USER_ID from AVUSER.T_ENTERPRISE_USERS where 
    CUS_ATTR_USER_CAS_9 = bu_owners)) select * from ..........

 

But My Othe business owner can not view the business unit users and when i check his access, i do not found these entitlements:

 

 

Can you explain me, how can i add this entitlements using sql?

Best Regards.

Outcomes