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: any; userId: string }): Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      • input: { role: string; tenantId: string; userContext: any; userId: string }
        • role: string
        • tenantId: string
        • userContext: any
        • 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?: any): Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
  • Parameters

    • tenantId: string
    • userId: string
    • role: string
    • Optional userContext: any

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

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

    • role: string
    • Optional userContext: any

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

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

    • tenantId: string
    • role: string
    • Optional userContext: any

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

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

    • tenantId: string
    • userId: string
    • role: string
    • Optional userContext: any

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

Generated using TypeDoc