The Custom Authorization Provider is used to determine users’ roles within the application.
Select C# Functions and enter a name.
From the Template field, select the Custom Authorization Provider template.
Click the CREATE button.
The class in the template implements the ICustomAuthorization interface and contains the GetRoles method.
GetRoles Method: Returns the roles the user has within the application as a List<string>.
Parameters:
appId (Guid): The application’s unique ID
appName (string): The application’s name
screenId (Guid): The screen’s unique ID
screenName (string): The screen’s name
userName (string): The user’s email address
If custom authorization is not to be applied, return null must be used. In this case, the default system behavior is preserved. If you want to return custom roles, uncomment the code return new List<string>() { “CustomRole1”, “CustomRole2” }; in the template, edit the role names, and remove the return null; line.
This structure can be used to define customized roles for users working on specific screens or in specific sections of the app.