cancel
Showing results for 
Search instead for 
Did you mean: 

Authorization Control for static actions in RAP / ABAP Cloud

sebastian_wilhelm1
Participant
0 Kudos

Hi experts!

I have an app with a static action (Button) on the List-Page. Now, I wanted to create an authorization control for the operations/actions in my app, but the static action is never requested in the get_global_authorization method (testing the app via the fiori elements preview app).

sebastian_wilhelm1_1-1708961773397.png

I need to disable the "Create List" Button depending on the business role.

sebastian_wilhelm1_0-1708961124353.png

The first time the get_global_authorization method is called is after pressing the go-button. As the button appears before pressing the go-button, the authorization check should be done direct after calling the app.

This is the action definition in the BEDF

static action createWithPlant deep parameter zkiat_d_create result [1] $self;

Any Ideas, how I can solve the problem?

I'm working with the free-tier model of the ABAP Environment on the BTP.

Thanks and regards,

Sebastian

View Entire Topic
AbhishekSharma
Active Contributor
0 Kudos

Hi @sebastian_wilhelm1 

You may want to try and use Instance Authorization instead of global. Instance auth can also be applied on Instance methods and custom roles can be used as needed method name that gets created is get_instance_autorization

I have posted full step by step blog which may help you, please visit below link:

https://community.sap.com/t5/technology-blogs-by-members/abap-rap-instance-authorization/ba-p/135708...

Hope this helps...

Thanks-

Abhishek

 

sebastian_wilhelm1
Participant
0 Kudos
Hi AbhishekSharma! Thanks for you comment. But I need a global button which should be deaktivated through authorization control before displaying the List view the first time. How could an instance authorization help me with the problem. But how could an instance authorization help me with the problem?
AbhishekSharma
Active Contributor
0 Kudos

Hi @sebastian_wilhelm1, What I understood from your post there is Create List button (static action) and you want to put auth check...

For Global authorization I have posted another Blog with detailed step by step... 

https://community.sap.com/t5/technology-blogs-by-members/abap-rap-global-authorization/ba-p/13558291 

 

Thanks-

Abhishek

sebastian_wilhelm1
Participant
0 Kudos

Hi @AbhishekSharma! I'm already using get_global_authorization. The problem is, that the method is triggered not before pressing the go-button and then the action (createwithplant) is not requested. So the button is diplayed and active.

sebastian_wilhelm1_0-1709051303440.png

Do you know, how I can disable/hide the button depending on authorization?