You are here

user_permissions.install in User Permissions 7

File

user_permissions.install
View source
<?php

/**
 * Creates a dummy role with no permissions
 */
function user_permissions_install() {
  $role = new stdClass();
  $role->name = USER_PERMISSIONS_NO_ROLE;
  user_role_save($role);
}

/**
 * Removes any roles created by this module.
 */
function user_permissions_uninstall() {
  $roles = user_roles();
  foreach ($roles as $rid => $name) {
    if (preg_match('/^_user_role_\\d+$/', $name)) {
      user_role_delete($rid);
    }
  }
}

Functions

Namesort descending Description
user_permissions_install Creates a dummy role with no permissions
user_permissions_uninstall Removes any roles created by this module.