View Source Appwrite.Utils.Permission (appwrite v0.1.9)
A helper module for generating permission strings for resources.
Summary
Functions
Generates a create permission string for the provided role.
Generates a delete permission string for the provided role.
Generates a read permission string for the provided role.
Generates an update permission string for the provided role.
Generates a write permission string for the provided role.
Functions
Generates a create permission string for the provided role.
Parameters
- role: A string representing the role.
Examples
iex> Permission.create("editor")
"create("editor")"
Generates a delete permission string for the provided role.
Parameters
- role: A string representing the role.
Examples
iex> Permission.delete("admin")
"delete("admin")"
Generates a read permission string for the provided role.
Parameters
- role: A string representing the role.
Examples
iex> Permission.read("user")
"read("user")"
Generates an update permission string for the provided role.
Parameters
- role: A string representing the role.
Examples
iex> Permission.update("moderator")
"update("moderator")"
Generates a write permission string for the provided role.
This is an alias of update, delete, and possibly create.
Avoid using write
in combination with update
, delete
, or create
.
Parameters
- role: A string representing the role.
Examples
iex> Permission.write("admin")
"write("admin")"