You are here

function _paranoia_remove_risky_permissions in Paranoia 7

Same name and namespace in other branches
  1. 8 paranoia.module \_paranoia_remove_risky_permissions()

Helper function to remove all risky permissions from any role.

Separated out from paranoia_permissions_submit so that there is clearly no dependency on a form or form state.

3 calls to _paranoia_remove_risky_permissions()
paranoia_enable in ./paranoia.install
Implements hook_enable().
paranoia_modules_enabled in ./paranoia.install
Implements hook_modules_enabled().
paranoia_permissions_submit in ./paranoia.module
Remove extremely-risky permissions from any role.

File

./paranoia.module, line 182
Paranoia module file. Provides various extra security features.

Code

function _paranoia_remove_risky_permissions() {
  $banned_permissions = module_invoke_all('paranoia_hide_permissions');
  foreach ($banned_permissions as $permission) {
    db_query("DELETE FROM {role_permission} WHERE permission = :permission", array(
      ':permission' => $permission,
    ));
  }
}