View Source Permission (appwrite v0.1.2)

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

@spec create(String.t()) :: String.t()

Generates a create permission string for the provided role.

Parameters

  • role: A string representing the role.

Examples

iex> Permission.create("editor")
"create("editor")"
@spec delete(String.t()) :: String.t()

Generates a delete permission string for the provided role.

Parameters

  • role: A string representing the role.

Examples

iex> Permission.delete("admin")
"delete("admin")"
@spec read(String.t()) :: String.t()

Generates a read permission string for the provided role.

Parameters

  • role: A string representing the role.

Examples

iex> Permission.read("user")
"read("user")"
@spec update(String.t()) :: String.t()

Generates an update permission string for the provided role.

Parameters

  • role: A string representing the role.

Examples

iex> Permission.update("moderator")
"update("moderator")"
@spec write(String.t()) :: String.t()

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")"