You are here

function content_access_get_permission_by_op in Content Access 6

Same name and namespace in other branches
  1. 8 content_access.module \content_access_get_permission_by_op()
  2. 7 content_access.module \content_access_get_permission_by_op()

Gets the name of a permission for the given operation, if there is a suiting one.

2 calls to content_access_get_permission_by_op()
content_access_get_rids_per_node_op in ./content_access.module
Returns optimized role ids for the given operation and node to grant access for.
content_access_get_setting_defaults in ./content_access.module
Defines default values for settings.
1 string reference to 'content_access_get_permission_by_op'
_content_access_get_node_permissions in ./content_access.admin.inc

File

./content_access.module, line 252
Content access module file.

Code

function content_access_get_permission_by_op($op, $type) {
  switch ($op) {
    default:
      return FALSE;
    case 'update':
      return 'edit any ' . $type . ' content';
    case 'update_own':
      return 'edit own ' . $type . ' content';
    case 'delete':
      return 'delete any ' . $type . ' content';
    case 'delete_own':
      return 'delete own ' . $type . ' content';
  }
}