Datasnap.DSAuth.TDSCustomAuthenticationManager.GetAuthRole

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function GetAuthRole(const ClassName, MethodName: string): TRoleAuth; virtual;

C++

virtual TRoleAuth* __fastcall GetAuthRole(const System::UnicodeString ClassName, const System::UnicodeString MethodName);

Properties

Type Visibility Source Unit Parent
function public
Datasnap.DSAuth.pas
Datasnap.DSAuth.hpp
Datasnap.DSAuth TDSCustomAuthenticationManager

Description

Returns a TRoleAuth instance for the given method.

GetAuthRole takes in a class name and method name, and builds a design-time TRoleAuth instance which has its authorized and denied roles populated correctly based on the contents of the Roles collection.

This does not do any special handling of the case where a role appears in both the authorized and denied lists. If this situation comes up, the Roles should either be redesigned, or the Authentication Manager should handle that case.

Note that if you assign UserRoles in the authentication event for a user, then those roles may be used to authorize the user. If this happens and a role assigned to the user is in the denies list (even if it is also in the authorized list), then the user will be denied if you choose to use the default authorization logic.