Search
Preparing search index...
The search index is not available
supertokens-node
Options
All
Public
Public/Protected
All
Inherited
Externals
Menu
supertokens-node
recipe/userroles
default
Class default
Hierarchy
default
Index
Constructors
constructor
Properties
init
Methods
add
Role
To
User
create
New
Role
Or
Add
Permissions
delete
Role
get
All
Roles
get
Permissions
For
Role
get
Roles
For
User
get
Roles
That
Have
Permission
get
Users
That
Have
Role
remove
Permissions
From
Role
remove
User
Role
Constructors
constructor
new default
(
)
:
default
Returns
default
Properties
Static
init
init
:
(
(
config
?:
TypeInput
)
=>
RecipeListFunction
)
= Recipe.init
Type declaration
(
config
?:
TypeInput
)
:
RecipeListFunction
Parameters
Optional
config:
TypeInput
Returns
RecipeListFunction
Methods
Static
add
Role
To
User
add
Role
To
User
(
userId
:
string
, role
:
string
, userContext
?:
any
)
:
Promise
<
{
didUserAlreadyHaveRole
:
boolean
;
status
:
"OK"
}
|
{
status
:
"UNKNOWN_ROLE_ERROR"
}
>
Parameters
userId:
string
role:
string
Optional
userContext:
any
Returns
Promise
<
{
didUserAlreadyHaveRole
:
boolean
;
status
:
"OK"
}
|
{
status
:
"UNKNOWN_ROLE_ERROR"
}
>
Static
create
New
Role
Or
Add
Permissions
create
New
Role
Or
Add
Permissions
(
role
:
string
, permissions
:
string
[]
, userContext
?:
any
)
:
Promise
<
{
createdNewRole
:
boolean
;
status
:
"OK"
}
>
Parameters
role:
string
permissions:
string
[]
Optional
userContext:
any
Returns
Promise
<
{
createdNewRole
:
boolean
;
status
:
"OK"
}
>
Static
delete
Role
delete
Role
(
role
:
string
, userContext
?:
any
)
:
Promise
<
{
didRoleExist
:
boolean
;
status
:
"OK"
}
>
Parameters
role:
string
Optional
userContext:
any
Returns
Promise
<
{
didRoleExist
:
boolean
;
status
:
"OK"
}
>
Static
get
All
Roles
get
All
Roles
(
userContext
?:
any
)
:
Promise
<
{
roles
:
string
[]
;
status
:
"OK"
}
>
Parameters
Optional
userContext:
any
Returns
Promise
<
{
roles
:
string
[]
;
status
:
"OK"
}
>
Static
get
Permissions
For
Role
get
Permissions
For
Role
(
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"
}
>
Static
get
Roles
For
User
get
Roles
For
User
(
userId
:
string
, userContext
?:
any
)
:
Promise
<
{
roles
:
string
[]
;
status
:
"OK"
}
>
Parameters
userId:
string
Optional
userContext:
any
Returns
Promise
<
{
roles
:
string
[]
;
status
:
"OK"
}
>
Static
get
Roles
That
Have
Permission
get
Roles
That
Have
Permission
(
permission
:
string
, userContext
?:
any
)
:
Promise
<
{
roles
:
string
[]
;
status
:
"OK"
}
>
Parameters
permission:
string
Optional
userContext:
any
Returns
Promise
<
{
roles
:
string
[]
;
status
:
"OK"
}
>
Static
get
Users
That
Have
Role
get
Users
That
Have
Role
(
role
:
string
, userContext
?:
any
)
:
Promise
<
{
status
:
"OK"
;
users
:
string
[]
}
|
{
status
:
"UNKNOWN_ROLE_ERROR"
}
>
Parameters
role:
string
Optional
userContext:
any
Returns
Promise
<
{
status
:
"OK"
;
users
:
string
[]
}
|
{
status
:
"UNKNOWN_ROLE_ERROR"
}
>
Static
remove
Permissions
From
Role
remove
Permissions
From
Role
(
role
:
string
, permissions
:
string
[]
, userContext
?:
any
)
:
Promise
<
{
status
:
"OK"
|
"UNKNOWN_ROLE_ERROR"
}
>
Parameters
role:
string
permissions:
string
[]
Optional
userContext:
any
Returns
Promise
<
{
status
:
"OK"
|
"UNKNOWN_ROLE_ERROR"
}
>
Static
remove
User
Role
remove
User
Role
(
userId
:
string
, role
:
string
, userContext
?:
any
)
:
Promise
<
{
didUserHaveRole
:
boolean
;
status
:
"OK"
}
|
{
status
:
"UNKNOWN_ROLE_ERROR"
}
>
Parameters
userId:
string
role:
string
Optional
userContext:
any
Returns
Promise
<
{
didUserHaveRole
:
boolean
;
status
:
"OK"
}
|
{
status
:
"UNKNOWN_ROLE_ERROR"
}
>
Modules
framework
framework/aws
Lambda
framework/express
framework/fastify
framework/hapi
framework/koa
framework/loopback
index
ingredients/emaildelivery
ingredients/smsdelivery
recipe/emailpassword
recipe/emailverification
recipe/jwt
recipe/openid
recipe/passwordless
recipe/session
recipe/thirdparty
recipe/thirdpartyemailpassword
recipe/thirdpartypasswordless
recipe/usermetadata
recipe/userroles
default
constructor
init
add
Role
To
User
create
New
Role
Or
Add
Permissions
delete
Role
get
All
Roles
get
Permissions
For
Role
get
Roles
For
User
get
Roles
That
Have
Permission
get
Users
That
Have
Role
remove
Permissions
From
Role
remove
User
Role
Generated using
TypeDoc