mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 15:50:13 +00:00
Declare hasPermission method on keycloak-connect package (#42490)
This commit is contained in:
2
types/keycloak-connect/index.d.ts
vendored
2
types/keycloak-connect/index.d.ts
vendored
@@ -1,6 +1,7 @@
|
||||
// Type definitions for keycloak-connect 4.5
|
||||
// Project: https://github.com/keycloak/keycloak-nodejs-connect, http://keycloak.org
|
||||
// Definitions by: Gregor Stamać <https://github.com/gstamac>
|
||||
// Blas Sackmann <https://github.com/SackSlab>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -62,6 +63,7 @@ declare namespace Keycloak {
|
||||
isExpired: () => boolean;
|
||||
hasRole: (roleName: string) => boolean;
|
||||
hasApplicationRole: (appName: string, roleName: string) => boolean;
|
||||
hasPermission: (resource: string, scope: string) => boolean;
|
||||
hasRealmRole: (roleName: string) => boolean;
|
||||
}
|
||||
|
||||
|
||||
@@ -65,6 +65,7 @@ _boolean = token.isExpired();
|
||||
_boolean = token.hasRole('roleName');
|
||||
_boolean = token.hasApplicationRole('appName', 'roleName');
|
||||
_boolean = token.hasRealmRole('roleName');
|
||||
_boolean = token.hasPermission('res:coffe', 'coffe:espresso');
|
||||
|
||||
const specHandler: Keycloak.SpecHandler = undefined;
|
||||
_boolean = specHandler(token, request, response);
|
||||
|
||||
Reference in New Issue
Block a user