RecipeInterface
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" }>
Parameters
input: { userContext: UserContext }
Returns 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" }>