Options
All
  • Public
  • Public/Protected
  • All
Menu

Module recipe/userroles

Index

Type Aliases

RecipeInterface: { addRoleToUser: any; createNewRoleOrAddPermissions: any; deleteRole: any; getAllRoles: any; getPermissionsForRole: any; getRolesForUser: any; getRolesThatHavePermission: any; getUsersThatHaveRole: any; removePermissionsFromRole: any; removeUserRole: any }

Type declaration

  • addRoleToUser:function
    • addRoleToUser(input: { role: string; tenantId: string; userContext: UserContext; userId: string }): Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • input: { role: string; tenantId: string; userContext: UserContext; userId: string }
        • role: string
        • tenantId: string
        • userContext: UserContext
        • userId: string

      Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

  • createNewRoleOrAddPermissions:function
    • createNewRoleOrAddPermissions(input: { permissions: string[]; role: string; userContext: UserContext }): Promise<{ createdNewRole: boolean; status: "OK" }>
    • Parameters

      • input: { permissions: string[]; role: string; userContext: UserContext }
        • permissions: string[]
        • role: string
        • userContext: UserContext

      Returns Promise<{ createdNewRole: boolean; status: "OK" }>

  • deleteRole:function
    • deleteRole(input: { role: string; userContext: UserContext }): Promise<{ didRoleExist: boolean; status: "OK" }>
    • Parameters

      • input: { role: string; userContext: UserContext }
        • role: string
        • userContext: UserContext

      Returns Promise<{ didRoleExist: boolean; status: "OK" }>

  • getAllRoles:function
    • getAllRoles(input: { userContext: UserContext }): Promise<{ roles: string[]; status: "OK" }>
  • getPermissionsForRole:function
    • getPermissionsForRole(input: { role: string; userContext: UserContext }): Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • input: { role: string; userContext: UserContext }
        • role: string
        • userContext: UserContext

      Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

  • getRolesForUser:function
    • getRolesForUser(input: { tenantId: string; userContext: UserContext; userId: string }): Promise<{ roles: string[]; status: "OK" }>
    • Parameters

      • input: { tenantId: string; userContext: UserContext; userId: string }
        • tenantId: string
        • userContext: UserContext
        • userId: string

      Returns Promise<{ roles: string[]; status: "OK" }>

  • getRolesThatHavePermission:function
    • getRolesThatHavePermission(input: { permission: string; userContext: UserContext }): Promise<{ roles: string[]; status: "OK" }>
    • Parameters

      • input: { permission: string; userContext: UserContext }
        • permission: string
        • userContext: UserContext

      Returns Promise<{ roles: string[]; status: "OK" }>

  • getUsersThatHaveRole:function
    • getUsersThatHaveRole(input: { role: string; tenantId: string; userContext: UserContext }): Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • input: { role: string; tenantId: string; userContext: UserContext }
        • role: string
        • tenantId: string
        • userContext: UserContext

      Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>

  • removePermissionsFromRole:function
    • removePermissionsFromRole(input: { permissions: string[]; role: string; userContext: UserContext }): Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • input: { permissions: string[]; role: string; userContext: UserContext }
        • permissions: string[]
        • role: string
        • userContext: UserContext

      Returns Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>

  • removeUserRole:function
    • removeUserRole(input: { role: string; tenantId: string; userContext: UserContext; userId: string }): Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • input: { role: string; tenantId: string; userContext: UserContext; userId: string }
        • role: string
        • tenantId: string
        • userContext: UserContext
        • userId: string

      Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

Variables

PermissionClaim: PermissionClaimClass = ...
UserRoleClaim: UserRoleClaimClass = ...

Functions

  • addRoleToUser(tenantId: string, userId: string, role: string, userContext?: Record<string, any>): Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
  • Parameters

    • tenantId: string
    • userId: string
    • role: string
    • Optional userContext: Record<string, any>

    Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

  • createNewRoleOrAddPermissions(role: string, permissions: string[], userContext?: Record<string, any>): Promise<{ createdNewRole: boolean; status: "OK" }>
  • Parameters

    • role: string
    • permissions: string[]
    • Optional userContext: Record<string, any>

    Returns Promise<{ createdNewRole: boolean; status: "OK" }>

  • deleteRole(role: string, userContext?: Record<string, any>): Promise<{ didRoleExist: boolean; status: "OK" }>
  • getAllRoles(userContext?: Record<string, any>): Promise<{ roles: string[]; status: "OK" }>
  • getPermissionsForRole(role: string, userContext?: Record<string, any>): Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
  • Parameters

    • role: string
    • Optional userContext: Record<string, any>

    Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

  • getRolesForUser(tenantId: string, userId: string, userContext?: Record<string, any>): Promise<{ roles: string[]; status: "OK" }>
  • getRolesThatHavePermission(permission: string, userContext?: Record<string, any>): Promise<{ roles: string[]; status: "OK" }>
  • getUsersThatHaveRole(tenantId: string, role: string, userContext?: Record<string, any>): Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
  • Parameters

    • tenantId: string
    • role: string
    • Optional userContext: Record<string, any>

    Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>

  • init(config?: TypeInput): RecipeListFunction
  • removePermissionsFromRole(role: string, permissions: string[], userContext?: Record<string, any>): Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
  • Parameters

    • role: string
    • permissions: string[]
    • Optional userContext: Record<string, any>

    Returns Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>

  • removeUserRole(tenantId: string, userId: string, role: string, userContext?: Record<string, any>): Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
  • Parameters

    • tenantId: string
    • userId: string
    • role: string
    • Optional userContext: Record<string, any>

    Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

Generated using TypeDoc