Copyright © 2010-2021 Marc Worrell
Authors: Marc Worrell (marc@worrell.nl).
acl() = [operationrequest()]
action() = use | admin | view | insert | update | delete | link | atom()
maybe_boolean() = undefined | boolean()
object() = m_rsc:resource() | #acl_rsc{} | #acl_edge{} | #acl_media{} | any()
operationrequest() = {action(), object()}
anondo/1 | |
anondo/2 | Call a function as the anonymous user. |
cache_key/1 | Return a term that can be used as the ACL part of cache key. |
is_admin/1 | Check if the current user is an admin or a sudo action. |
is_allowed/3 | Check if an action is allowed for the current actor. |
is_allowed_prop/4 | Check if an action on a property of a resource is allowed for the current actor. |
is_read_only/1 | |
logoff/1 | Log off, reset the acl field of the context. |
logon/2 | Log the user with the id on, fill the acl field of the context. |
logon/3 | |
logon_prefs/2 | Log the user with the id on, fill acl and set all user preferences (like timezone and language). |
logon_prefs/3 | |
logon_refresh/1 | Refresh the authentication of the current user. |
maybe_allowed/3 | |
rsc_deletable/2 | Check if the resource is deletable by the current user. |
rsc_editable/2 | Check if the resource is editable by the current user. |
rsc_linkable/2 | Check if the resource is connected to another resource by the current user. |
rsc_prop_visible/3 | Check if a property of the resource is visible for the current user. |
rsc_visible/2 | Check if the resource is visible for the current user. |
set_read_only/2 | |
sudo/1 | |
sudo/2 | Call a function with admin privileges. |
user/1 | Return the id of the current user. |
user_groups/1 | Return the list of user groups the current context is member of. |
anondo(Context::z:context()) -> z:context()
anondo(Fun, Context::z:context()) -> any()
Call a function as the anonymous user.
cache_key(Context::z:context()) -> {m_rsc:resource_id() | undefined, any()}
Return a term that can be used as the ACL part of cache key.
is_admin(Context::z:context()) -> boolean()
Check if the current user is an admin or a sudo action
is_allowed(Action::action(), Object::object(), Context::z:context()) -> boolean()
Check if an action is allowed for the current actor.
is_allowed_prop(Action::action(), Object::object(), Property::atom() | binary(), Context::z:context()) -> true | false | undefined
Check if an action on a property of a resource is allowed for the current actor.
is_read_only(Context::z:context()) -> boolean()
logoff(Context::z:context()) -> z:context()
Log off, reset the acl field of the context
logon(Id::m_rsc:resource() | undefined, Context::z:context()) -> z:context()
Log the user with the id on, fill the acl field of the context
logon(Id::m_rsc:resource() | undefined, Options::map(), Context::z:context()) -> z:context()
logon_prefs(Id::m_rsc:resource_id(), Context::z:context()) -> z:context()
Log the user with the id on, fill acl and set all user preferences (like timezone and language)
logon_prefs(Id::m_rsc:resource_id(), Options::map(), Context::z:context()) -> z:context()
logon_refresh(Context::z:context()) -> z:context()
Refresh the authentication of the current user
maybe_allowed(Action::action(), Object::object(), Context::z:context()) -> maybe_boolean()
rsc_deletable(Id::m_rsc:resource(), Context::z:context()) -> boolean()
Check if the resource is deletable by the current user
rsc_editable(Id::m_rsc:resource(), Context::z:context()) -> boolean()
Check if the resource is editable by the current user
rsc_linkable(Id::m_rsc:resource(), Context::z:context()) -> boolean()
Check if the resource is connected to another resource by the current user
rsc_prop_visible(Id::m_rsc:resource(), Property::atom() | binary(), Context::z:context()) -> boolean()
Check if a property of the resource is visible for the current user
rsc_visible(Id::m_rsc:resource(), Context::z:context()) -> boolean()
Check if the resource is visible for the current user
set_read_only(IsReadOnly::boolean(), Context::z:context()) -> z:context()
sudo(Context::z:context()) -> z:context()
sudo(Fun, Context::z:context()) -> any()
Call a function with admin privileges.
user(Context::z:context()) -> m_rsc:resource_id() | undefined
Return the id of the current user.
user_groups(Context::z:context()) -> [m_rsc:resource_id()]
Return the list of user groups the current context is member of.
Generated by EDoc