TsgcWSAPIKeyManager › Methods › ListScopes
Returns the scopes attached to a key.
function ListScopes(const aKey: string): TsgcAPIKeyScopes;
| Name | Type | Description |
|---|---|---|
aKey | const string | Raw plaintext key to inspect (re-hashed internally). |
A TsgcAPIKeyScopes dynamic array (array of string) with the scope identifiers attached to the key. Empty array when the key is unknown or carries no scopes. The returned array is a copy — modifying it does not alter the stored state. (TsgcAPIKeyScopes)
Read-only snapshot of the scope list currently stored for the key, in insertion order. Use it to paint the "Permissions" panel of an admin UI, to mirror scopes into a JWT claim set, or to compare against the Scopes catalog when auditing drift. To check a single scope use HasScope (constant-time) rather than scanning the array yourself.
var
oScopes: TsgcAPIKeyScopes;
vScope: string;
begin
oScopes := sgcWSAPIKeyManager1.ListScopes(vKey);
for vScope in oScopes do
Memo1.Lines.Add('Scope: ' + vScope);
end;