You are here

function content_access_get_setting_defaults in Content Access 8

Same name and namespace in other branches
  1. 5 content_access.module \content_access_get_setting_defaults()
  2. 6 content_access.module \content_access_get_setting_defaults()
  3. 7 content_access.module \content_access_get_setting_defaults()

Defines default values for settings.

2 calls to content_access_get_setting_defaults()
content_access_get_settings in ./content_access.module
Return content_access' settings.
content_access_set_settings in ./content_access.module
Save content_access settings of a content type.

File

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

Code

function content_access_get_setting_defaults($type) {
  $defaults = [];
  $defaults['view'] = $defaults['view_own'] = [
    AccountInterface::ANONYMOUS_ROLE,
    AccountInterface::AUTHENTICATED_ROLE,
  ];
  foreach ([
    'update',
    'delete',
  ] as $op) {
    $defaults[$op] = content_access_get_permission_access(content_access_get_permission_by_op($op, $type));
    $defaults[$op . '_own'] = content_access_get_permission_access(content_access_get_permission_by_op($op . '_own', $type));
  }
  $defaults['priority'] = 0;
  $defaults['per_node'] = FALSE;
  return $defaults;
}