user_permissions.install in User Permissions 7
Same filename and directory in other branches
File
user_permissions.installView 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
Name | Description |
---|---|
user_permissions_install | Creates a dummy role with no permissions |
user_permissions_uninstall | Removes any roles created by this module. |