@icgc-argo/ego-token-utils
Advanced tools
Comparing version 8.1.1 to 8.2.0
export declare const DCC_ADMIN_PERMISSION = "PROGRAMSERVICE.WRITE"; | ||
export declare const RDPC_PREFIX = "RDPC-"; | ||
export declare const DACO_ADMIN_PERMISSION = "DACO-REVIEW.WRITE"; | ||
/** | ||
* check if a given jwt has dcc access | ||
* @param egoJwt | ||
* check if a given set of permissions has dcc access | ||
* @param permissions | ||
*/ | ||
export declare const isDccMember: (permissions: string[]) => boolean; | ||
/** | ||
* check if a given jwt has rdpc access | ||
* @param egoJwt | ||
* check if a given set of permissions has rdpc access | ||
* @param permissions | ||
*/ | ||
export declare const isRdpcMember: (permissions: string[]) => boolean; | ||
/** | ||
* check if a given set of permissions has daco admin access | ||
* @param permissions | ||
*/ | ||
export declare const isDacoAdmin: (permissions: string[]) => boolean; |
@@ -16,2 +16,3 @@ import { PermissionScopeObj } from './common'; | ||
isRdpcMember: (permissions: string[]) => boolean; | ||
isDacoAdmin: (permissions: string[]) => boolean; | ||
getPermissionsFromToken: (egoJwt: string) => string[]; | ||
@@ -18,0 +19,0 @@ getReadableProgramScopes: (permissions: string[]) => PermissionScopeObj[]; |
@@ -25,5 +25,6 @@ "use strict"; | ||
exports.RDPC_PREFIX = 'RDPC-'; | ||
exports.DACO_ADMIN_PERMISSION = 'DACO-REVIEW.WRITE'; | ||
/** | ||
* check if a given jwt has dcc access | ||
* @param egoJwt | ||
* check if a given set of permissions has dcc access | ||
* @param permissions | ||
*/ | ||
@@ -34,4 +35,4 @@ exports.isDccMember = function (permissions) { | ||
/** | ||
* check if a given jwt has rdpc access | ||
* @param egoJwt | ||
* check if a given set of permissions has rdpc access | ||
* @param permissions | ||
*/ | ||
@@ -56,2 +57,9 @@ exports.isRdpcMember = function (permissions) { | ||
}; | ||
/** | ||
* check if a given set of permissions has daco admin access | ||
* @param permissions | ||
*/ | ||
exports.isDacoAdmin = function (permissions) { | ||
return permissions.includes(exports.DACO_ADMIN_PERMISSION); | ||
}; | ||
//# sourceMappingURL=argoRoleChecks.js.map |
@@ -224,2 +224,3 @@ "use strict"; | ||
isRdpcMember: argoRoleChecks_1.isRdpcMember, | ||
isDacoAdmin: argoRoleChecks_1.isDacoAdmin, | ||
getPermissionsFromToken: getPermissionsFromToken(egoPublicKey), | ||
@@ -226,0 +227,0 @@ getReadableProgramScopes: getReadableProgramScopes, |
export declare const DCC_ADMIN_PERMISSION = "PROGRAMSERVICE.WRITE"; | ||
export declare const RDPC_PREFIX = "RDPC-"; | ||
export declare const DACO_ADMIN_PERMISSION = "DACO-REVIEW.WRITE"; | ||
/** | ||
* check if a given jwt has dcc access | ||
* @param egoJwt | ||
* check if a given set of permissions has dcc access | ||
* @param permissions | ||
*/ | ||
export declare const isDccMember: (permissions: string[]) => boolean; | ||
/** | ||
* check if a given jwt has rdpc access | ||
* @param egoJwt | ||
* check if a given set of permissions has rdpc access | ||
* @param permissions | ||
*/ | ||
export declare const isRdpcMember: (permissions: string[]) => boolean; | ||
/** | ||
* check if a given set of permissions has daco admin access | ||
* @param permissions | ||
*/ | ||
export declare const isDacoAdmin: (permissions: string[]) => boolean; |
@@ -16,2 +16,3 @@ import { PermissionScopeObj } from './common'; | ||
isRdpcMember: (permissions: string[]) => boolean; | ||
isDacoAdmin: (permissions: string[]) => boolean; | ||
getPermissionsFromToken: (egoJwt: string) => string[]; | ||
@@ -18,0 +19,0 @@ getReadableProgramScopes: (permissions: string[]) => PermissionScopeObj[]; |
{ | ||
"name": "@icgc-argo/ego-token-utils", | ||
"version": "8.1.1", | ||
"version": "8.2.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
888263
10020