You are here

function content_access_get_permission_by_op in Content Access 7

Same name and namespace in other branches
  1. 8 content_access.module \content_access_get_permission_by_op()
  2. 6 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.

3 calls to content_access_get_permission_by_op()
content_access_admin_settings_submit in ./content_access.admin.inc
Submit handler for per content type settings form.
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.module
Gets node's access permissions.

File

./content_access.module, line 294
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';
  }
}