You have been redirected from an outdated version of the article. Below is the content available on this topic. To view the old article click here.

grant()

Usage

grant(principal, node, permissions)

Description
Grants the given permissions on the given node to the given principal. This method creates or modifies the security relationship between the first two parameters. Valid values for the permission list are read, write, delete and accessControl. The permissions are passed in as a comma-separated list (see the examples below). The return value is the empty string. See also revoke() and is_allowed().

Example

${grant(me, node1, 'read')}
${grant(me, node2, 'read, write')}
${grant(me, node3, 'read, write, delete')}
${grant(me, node4, 'read, write, delete, accessControl')}

Search results for "grant()"

grant()

Grants the given permissions on the given node to the given principal. This method creates or modifies the security relationship between the first two parameters. Valid values for the permission list are read, write, delete and accessControl. The permissions are passed in as a comma-separated list (see the examples below). The return value is the empty string. See also revoke() and is_allowed().

grant(principal, node, permissions)

Permission Grants

This lifecycle method has to be created on every schema type the creating user should not have a SECURITY relationship to.

Note: If both OWNS and SECURITY are skipped for non-admin users, the user probably has no rights to even see the node after creating it. Using Access Control Functions grant() or copy_permissions() the user/group can get rights to the node.