cancel
Showing results for 
Search instead for 
Did you mean: 

How to check roles/permissions with HTML5(HCP)?

0 Kudos

Hello 🙂

I want to build a HTML5 app for my HCP wich is aware of roles/permissions of an user.

With security constraints and permissions one is able to create restricted areas of the application. If one does not have the right permission, one is not able to access the specific area.

But how is it possible to check which permissions an user has?

Example:

An app where one has to login to see details of whatever. If one has the role of an editor, one should see a button "edit". If one does not have this role (or permission), the button should not be visible.

How am i able to check this kind of user attributes? (because they are not included in the attributes /service/userapi/attributes or /currentuser)

thanks in advance 🙂

Edit:

I don´t mean how to assign roles to permissions, but how to check which permissions the specific user has while using the app.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Please Tell me how you had done it ,

i am also stucked in this Problem..

0 Kudos

I got is working... replaced the ?$ with just ?

/services/userapi/attributes?multiValuesAsArrays=true
0 Kudos

Hi.

Did you get an elegant solution to this (along the lines of using user api services)??

There is mention of a URL parameter multiValuesAsArrays. i tried using:

/services/userapi/attributes?$multiValuesAsArrays=true 

but i cant get this to return an array of user_groups

Former Member
0 Kudos

Hello,

roles for a user can be checked in the SAP CLOUD PLATFORM Cockpit (see 4. 😞

Alternatively, you can do it using the Authorizations section for the account.

  1. In the cockpit, go to the Start of the navigation path Security Next navigation step Authorizations End of the navigation path section for the account.
  2. Enter the Users or Groups tab respectively.
  3. In the User or Group field respectively, enter the name of the required user or group. If you want to create a new user or group, simply assign the required roles from here.
  4. Choose Show Assignments. The table below shows all roles that are already assigned to this user or group.

Permissions for an HTML5 application are defined in the application descriptor file. This is done by the developer so far as I know.

0 Kudos

Thanks for your answer, but this is not what i meant.

I have created roles and groups in the cockpit and also permissions in the applications descriptor file. They are also "connected".

But I want to know, which of these roles/permissions the specific logged-in user has while using the app. Some variables to check or something. An array of permissions, a path, json or whatever.