cancel
Showing results for 
Search instead for 
Did you mean: 

XS Advanced: Scopes & Role Templates

0 Kudos

Hi Colleagues,

I am developing a NodeJS application on XS Advanced, and I am creating scopes and role templates for my application users. There are two type of roles UserAdmin and User.  Is there a way to get which scopes or role templates the user has from the session ? And if so how can I get this information ?

Thank you,

Best Regards,

Shady

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I'd recommend assigning the scopes to routes/HTTP verbs in the xs-app.json of the web module of your application whenever possible. This allows the checks to take place without application coding.

If you need the scopes within Node.js, then use the sap-xssec module.

This module has functions like checkScope.

checkScope

checks a scope that is published by an application.

Parameters:

  • scope ... the scope whose existence is checked against the available scopes of the current user. Here, the prefix is required, thus the scope string is "globally unique".
  • returns true if the scope is contained in the user's scopes, false otherwise

Answers (0)