Assign a role to a user.
Overloads:
assignRoleToUser(userId: number, roleId: number): Promise<boolean | null> Assign by role id without context.
assignRoleToUser(userId: number, roleName: string): Promise<boolean | null> Assign by role name without context.
assignRoleToUser(userId: number, roleId: number, streamerId: number): Promise<boolean | null> Assign by role id within a specific streamer/context.
assignRoleToUser(userId: number, roleName: string, streamerId: number): Promise<boolean | null> Assign by role name within a specific streamer/context.
Generic parameters:
ID of the user receiving the role.
true if the operation succeeded, false if it did not, or null in some DB-specific cases.
Assign a role to a user.
Overloads:
assignRoleToUser(userId: number, roleId: number): Promise<boolean | null> Assign by role id without context.
assignRoleToUser(userId: number, roleName: string): Promise<boolean | null> Assign by role name without context.
assignRoleToUser(userId: number, roleId: number, streamerId: number): Promise<boolean | null> Assign by role id within a specific streamer/context.
assignRoleToUser(userId: number, roleName: string, streamerId: number): Promise<boolean | null> Assign by role name within a specific streamer/context.
Generic parameters:
ID of the user receiving the role.
true if the operation succeeded, false if it did not, or null in some DB-specific cases.
Assign a role to a user.
Overloads:
assignRoleToUser(userId: number, roleId: number): Promise<boolean | null> Assign by role id without context.
assignRoleToUser(userId: number, roleName: string): Promise<boolean | null> Assign by role name without context.
assignRoleToUser(userId: number, roleId: number, streamerId: number): Promise<boolean | null> Assign by role id within a specific streamer/context.
assignRoleToUser(userId: number, roleName: string, streamerId: number): Promise<boolean | null> Assign by role name within a specific streamer/context.
Generic parameters:
ID of the user receiving the role.
Optional context id (e.g. streamer) to scope the assignment.
true if the operation succeeded, false if it did not, or null in some DB-specific cases.
Assign a role to a user.
Overloads:
assignRoleToUser(userId: number, roleId: number): Promise<boolean | null> Assign by role id without context.
assignRoleToUser(userId: number, roleName: string): Promise<boolean | null> Assign by role name without context.
assignRoleToUser(userId: number, roleId: number, streamerId: number): Promise<boolean | null> Assign by role id within a specific streamer/context.
assignRoleToUser(userId: number, roleName: string, streamerId: number): Promise<boolean | null> Assign by role name within a specific streamer/context.
Generic parameters:
ID of the user receiving the role.
Optional context id (e.g. streamer) to scope the assignment.
true if the operation succeeded, false if it did not, or null in some DB-specific cases.
Check whether a user has a given permission.
Overloads:
checkIfUserHasPermission(userId: number, permissionName: string): Promise<boolean | null> Check by permission name without context.
checkIfUserHasPermission(userId: number, permissionId: number): Promise<boolean | null> Check by permission id without context.
checkIfUserHasPermission(userId: number, permissionName: string, streamerId: number): Promise<boolean | null> Check by permission name within a specific streamer/context.
checkIfUserHasPermission(userId: number, permissionId: number, streamerId: number): Promise<boolean | null> Check by permission id within a specific streamer/context.
Generic parameters:
ID of the user.
true if the user has the permission, false otherwise, or null in DB-specific cases.
Check whether a user has a given permission.
Overloads:
checkIfUserHasPermission(userId: number, permissionName: string): Promise<boolean | null> Check by permission name without context.
checkIfUserHasPermission(userId: number, permissionId: number): Promise<boolean | null> Check by permission id without context.
checkIfUserHasPermission(userId: number, permissionName: string, streamerId: number): Promise<boolean | null> Check by permission name within a specific streamer/context.
checkIfUserHasPermission(userId: number, permissionId: number, streamerId: number): Promise<boolean | null> Check by permission id within a specific streamer/context.
Generic parameters:
ID of the user.
true if the user has the permission, false otherwise, or null in DB-specific cases.
Check whether a user has a given permission.
Overloads:
checkIfUserHasPermission(userId: number, permissionName: string): Promise<boolean | null> Check by permission name without context.
checkIfUserHasPermission(userId: number, permissionId: number): Promise<boolean | null> Check by permission id without context.
checkIfUserHasPermission(userId: number, permissionName: string, streamerId: number): Promise<boolean | null> Check by permission name within a specific streamer/context.
checkIfUserHasPermission(userId: number, permissionId: number, streamerId: number): Promise<boolean | null> Check by permission id within a specific streamer/context.
Generic parameters:
ID of the user.
Optional context id.
true if the user has the permission, false otherwise, or null in DB-specific cases.
Check whether a user has a given permission.
Overloads:
checkIfUserHasPermission(userId: number, permissionName: string): Promise<boolean | null> Check by permission name without context.
checkIfUserHasPermission(userId: number, permissionId: number): Promise<boolean | null> Check by permission id without context.
checkIfUserHasPermission(userId: number, permissionName: string, streamerId: number): Promise<boolean | null> Check by permission name within a specific streamer/context.
checkIfUserHasPermission(userId: number, permissionId: number, streamerId: number): Promise<boolean | null> Check by permission id within a specific streamer/context.
Generic parameters:
ID of the user.
Optional context id.
true if the user has the permission, false otherwise, or null in DB-specific cases.
ProtectedexecuteProtectedexecuteGet permissions granted to a user (via roles).
Overloads:
getUserPermissions(userId: number): Promise<Permission[]> Get all permissions for the user globally.
getUserPermissions(userId: number, streamerId: number): Promise<Permission[]> Get permissions for the user within the given streamer/context.
ID of the user.
Array of Permission objects, or empty array when no records found.
Get permissions granted to a user (via roles).
Overloads:
getUserPermissions(userId: number): Promise<Permission[]> Get all permissions for the user globally.
getUserPermissions(userId: number, streamerId: number): Promise<Permission[]> Get permissions for the user within the given streamer/context.
ID of the user.
Optional context id to limit the query.
Array of Permission objects, or empty array when no records found.
Get roles assigned to a user.
Overloads:
getUserRoles(userId: number): Promise<Role[]> Get all roles assigned to the user globally.
getUserRoles(userId: number, streamerId: number): Promise<Role[]> Get roles assigned to the user within the given streamer/context.
ID of the user.
Array of Role objects, or empty array when no records found.
Get roles assigned to a user.
Overloads:
getUserRoles(userId: number): Promise<Role[]> Get all roles assigned to the user globally.
getUserRoles(userId: number, streamerId: number): Promise<Role[]> Get roles assigned to the user within the given streamer/context.
ID of the user.
Optional context id to limit the query.
Array of Role objects, or empty array when no records found.
ProtectedmapProtectedmapProtectedmapRevoke a role from a user.
Overloads:
revokeRoleFromUser(userId: number, roleId: number): Promise<boolean | null> Revoke by role id without context.
revokeRoleFromUser(userId: number, roleName: string): Promise<boolean | null> Revoke by role name without context.
revokeRoleFromUser(userId: number, roleId: number, streamerId: number): Promise<boolean | null> Revoke by role id within a specific streamer/context.
revokeRoleFromUser(userId: number, roleName: string, streamerId: number): Promise<boolean | null> Revoke by role name within a specific streamer/context.
Generic parameters:
ID of the user.
true if revoked, false otherwise, or null if DB returns no definitive result.
Revoke a role from a user.
Overloads:
revokeRoleFromUser(userId: number, roleId: number): Promise<boolean | null> Revoke by role id without context.
revokeRoleFromUser(userId: number, roleName: string): Promise<boolean | null> Revoke by role name without context.
revokeRoleFromUser(userId: number, roleId: number, streamerId: number): Promise<boolean | null> Revoke by role id within a specific streamer/context.
revokeRoleFromUser(userId: number, roleName: string, streamerId: number): Promise<boolean | null> Revoke by role name within a specific streamer/context.
Generic parameters:
ID of the user.
true if revoked, false otherwise, or null if DB returns no definitive result.
Revoke a role from a user.
Overloads:
revokeRoleFromUser(userId: number, roleId: number): Promise<boolean | null> Revoke by role id without context.
revokeRoleFromUser(userId: number, roleName: string): Promise<boolean | null> Revoke by role name without context.
revokeRoleFromUser(userId: number, roleId: number, streamerId: number): Promise<boolean | null> Revoke by role id within a specific streamer/context.
revokeRoleFromUser(userId: number, roleName: string, streamerId: number): Promise<boolean | null> Revoke by role name within a specific streamer/context.
Generic parameters:
ID of the user.
Optional context id to scope the revocation.
true if revoked, false otherwise, or null if DB returns no definitive result.
Revoke a role from a user.
Overloads:
revokeRoleFromUser(userId: number, roleId: number): Promise<boolean | null> Revoke by role id without context.
revokeRoleFromUser(userId: number, roleName: string): Promise<boolean | null> Revoke by role name without context.
revokeRoleFromUser(userId: number, roleId: number, streamerId: number): Promise<boolean | null> Revoke by role id within a specific streamer/context.
revokeRoleFromUser(userId: number, roleName: string, streamerId: number): Promise<boolean | null> Revoke by role name within a specific streamer/context.
Generic parameters:
ID of the user.
Optional context id to scope the revocation.
true if revoked, false otherwise, or null if DB returns no definitive result.
Protectedscalar
Protected constructor to enforce singleton usage via getInstance.