replace()
Replace a role.
Description
The replace()
method replaces a role with the object supplied. This
method removes any fields on the existing role that aren’t supplied by the
object, with some exceptions. The immutable metadata fields coll
and ts
aren’t removed and cannot be replaced.
The object must include the required fields.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
data |
Yes |
Object describing the role. |
data fields
Name | Type | Required | Description |
---|---|---|---|
name |
Yes |
Unique name. |
|
privileges |
Yes |
One or more privilege configuration objects. |
|
membership |
One or more membership configuration objects. |
||
data |
User-defined metadata that stores supplemental information. |
Examples
{
name: "managementTeam",
coll: Role,
ts: Time("2023-07-27T22:38:33.860Z"),
membership: {
resource: "Customers"
}
}
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!