You are here

function config_perms_save in Custom Permissions 6.2

Same name and namespace in other branches
  1. 7.2 config_perms.module \config_perms_save()

Inserts or updates a perm into the database.

Parameters

$preset: The perm object to be inserted.

1 call to config_perms_save()
config_perms_admin_form_submit in ./config_perms.admin.inc
Submit handler.

File

./config_perms.module, line 166
Adds more granular permissions for items under 'administer site configuration'.

Code

function config_perms_save($perm) {
  $perm = (object) $perm;

  // Generate machine name
  $perm->machine_name = config_perms_generate_machine_name($perm->name);
  if ($perm->pid) {
    drupal_write_record('config_perms', $perm, 'pid');
  }
  else {
    drupal_write_record('config_perms', $perm);
  }
  return TRUE;
}