Skip to content

Commit

Permalink
Types for isInRole function
Browse files Browse the repository at this point in the history
  • Loading branch information
StorytellerCZ committed Feb 3, 2024
1 parent fb87df7 commit 24efbb7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions definitions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,17 @@ declare namespace Roles {
options?: string | { scope?: string; anyScope?: boolean }
): Promise<boolean>

/**
* Check if current user is in at least one of the target roles.
* @method isInRole
* @param {String} role Name of role or comma-seperated list of roles.
* @param {String} [scope] Optional, name of scope to check.
* @return {Boolean} `true` if current user is in at least one of the target roles.
* @static
*/
function isInRole(role: string, scope: string[]): boolean
function isInRoleAsync(role: string, scope: string[]): Promise<boolean>

// The schema for the roles collection
interface Role {
_id: string
Expand Down

0 comments on commit 24efbb7

Please sign in to comment.