Skip to Content

Assign a Role Collection to a User

test
0 %
Assign a Role Collection to a User
Details

Assign a Role Collection to a User

November 3, 2021
Created by
June 14, 2021
This tutorial shows you how to assign roles to users.

You will learn

  • How to assign roles to users
QR code


Step 1: Assign roles

To be able to access the application, your user needs to be assigned to a role collection that provides the required scopes.

  1. Open the SAP BTP Cockpit.

  2. Go to the Subaccount where you have deployed your service and application.

  3. Choose Security Role Collections on the left.

  4. Select RiskManager-<your space> in the list of role collections.

  5. Choose Edit.

  6. Enter the E-Mail Address of your user.

  7. Choose Save.

The name of the role collection includes the name of your space

The role collections are created automatically using the xs-security.json file. Hence, the name of the role collection includes the name of your space where you have deployed your service and application. For example, if the space name is dev, then the name of the role collection will be RiskManager-dev.

Your user now appears in the list of the role collection’s users.

What is the naming pattern for role collections?
×

Step 2: Test it

Go to the application and choose the tile Risks. You should be able to create entries in the Risks application.

If not, probably you have signed in before adding the role collection to your user. Sign out and sign in again to get the added roles in your login ticket.

Why there’s no data in the Risks application?

As explained in section Exclude CSV files from deployment, test files should never be deployed to an SAP HANA database as table data. For this reason, we’ve excluded the test files from the deployment archive before deployment.

Log on to answer question

Step 3: Additional Information: Create a role collection manually

Instead of creating the role collection automatically using the xs-security.json, it’s also possible to create a role collection manually. For example:

  1. Open the SAP BTP Cockpit.

  2. Go to the Subaccount.

  3. Choose Security Role Collections on the left.

  4. Choose the + (new role collection) button.

  5. Enter Name RiskManager.

  6. Choose Create.

The new role collection appears now in the list, but it doesn’t contain any roles. To add a role:

  1. Choose the RiskManager role collection.

  2. Choose Edit.

  3. Open the value help for Role Name.

    RoleName value help
  4. Select cpapp-...!... in Application Identifier dropdown.

    Application Identifier

    The App Identifier is the XSAPPID of your application. It consists of the XSAPPNAME that’s been used to create the XSUAA service followed by an exclamation mark (!) and a landscape-wide unique ID.

  5. Select RiskManager in list of roles.

  6. Choose Add.

  7. Choose Save.

Log on to answer question

Next Steps

Back to top