Skip to Content
0

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

Feb 28, 2017 at 09:18 AM

506

avatar image

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

avatar image
Former Member Mar 14, 2017 at 10:55 AM
-1

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.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

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.

0
sergio congia Apr 03 at 07:37 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
sergio congia Apr 05 at 12:41 PM
0

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

/services/userapi/attributes?multiValuesAsArrays=true
Share
10 |10000 characters needed characters left characters exceeded