分类: Web开发
2018-09-04 14:08:32
方法 CL_CRM_UI_PROFILE_DETERM=>LOAD_PROFILES 来获取登录用户的business role。
有三个途径维护 角色
* get business role from user parameter
IF iv_get_from_param EQ abap_true.
me->load_from_user_parameter( iv_user = iv_user ).
lv_sort = 'PROFILE_NAME'.
ENDIF.
* get business roles that are assigned to the user within organizational management
IF iv_get_from_org EQ abap_true AND me->profiles_nested IS INITIAL.
me->load_from_org_management( iv_user = iv_user ).
lv_sort = 'PROFILE_DESCR'.
ENDIF.
* alternatively get business roles having a PFCG role that is also assigned to the user
IF iv_get_from_pfcg EQ abap_true AND me->profiles_nested IS INITIAL.
me->load_from_pfcg_role( iv_user = iv_user ).
lv_sort = 'PROFILE_DESCR'.
ENDIF.
获取到 角色后, BADI:wcf_restrict_access_badi->get_business_role_white_list
可以增强,只显示特定白名单内的角色。