permissions_api 6.x-3.0

New features
Bug fixes
Unsupported

The 3.0 release of this module includes new functions for granting and revoking permissions:

permissions_api 6.x-3.x-dev

New features
Bug fixes
  • #1244290 - Refactored the Drush interface to use options for controlling permission grants and revokes in a number of different cases.
  • Added new functions to Permissions API to support all possible use cases

permissions_api 6.x-2.14

Unsupported

#1410620 - Add sorting to permissions returned by permissions_get_permissions_for_role()

permissions_api 6.x-2.13

Bug fixes
Unsupported

#934152 - fixed bug where permissions_revoke_permission() on a role with only one permission updated the entry in the permission table to an empty string instead of deleting the entry. Subsequent permission grants resulted in an additional row being inserted into the permission table, which could cause permission grants to fail.

permissions_api 6.x-2.11

Bug fixes
Unsupported

#897774: Drush errors when permission api not enabled. - Fixed a bug in the Drush integration where it was possible to call Permissions API methods via Drush even though the module was not enabled, which would result in errors.

permissions_api 6.x-2.10

New features
Unsupported

#824538 - Added patch provided by jonathan_hunt and langworthy, which provides functionality in drush to delete a role.

permissions_api 6.x-2.9

New features
Unsupported

#802248: Add support for Drush - Permissions API now comes with support for Drush commands!

drush help | grep perm

permissions_api 6.x-2.8

Bug fixes
Unsupported

#763786: D6 version not cross referencing incoming permissions with available permissions On grant and revoke actions, user-supplied permissions were not being validated against defined permissions.

permissions_api 6.x-2.7

New features
Bug fixes
Unsupported

#628184: Remove unnecessary .project file from CVS - Removed unnecessary .project file

Added API support for creating new roles:

$new_role = permissions_create_role($role_name);

This will further assist with automated deployments.

permissions_api 6.x-2.4

Bug fixes
Unsupported

As noted at #492366: Previous Patch Missing, a patch previously supplied at #405434: INSERT INTO clause missing field names was missing. This version reincorporates the missing patch.

permissions_api 6.x-2.3

New features
Unsupported

This version adds a new function to the API:

permissions_role_inherit()

This function allows one role to inherit all the permissions of another role. Example usage:

permissions_role_inherit('new role', 'original role');

permissions_api 6.x-2.1

Bug fixes
Unsupported

Applied patch provided in issue #459064 to fix incorrect parameters being sent to permissions_get_permissions_for_role(). This is a critical fix to prevent loss of existing permissions.

permissions_api 6.x-2.0

Bug fixes
Unsupported

Fixed bug in queries for granting new permissions to roles, as reported at http://drupal.org/node/405434

permissions_api 6.x-2.x-dev

New features

UPDATE: This version of the module has changed the first argument to all APIs defined by this module. In prior versions, the first argument was an integer representing a role id. This new version accepts a string representing the name of a role, and each API does a lookup to retrieve the proper role id.

The permissions_api module provides a method for adding and removing permissions from a given role. This module helps with the issue of staging a Drupal site across multiple environments, from development sandbox to production environment.

A specific example includes importing a CCK content type definition via hook_update in a custom module:

// Configure the path to the cck content type definition
$modulepath = drupal_get_path ('module', 'some_module');
$cck_definition_file = $modulepath.'/content_types/front_page_flash.php';
$values['type_name'] = '<create>';
$values['macro'] = file_get_contents($cck_definition_file);
 
include_once( drupal_get_path('module', 'node') .'/content_types.inc');
include_once( drupal_get_path('module', 'content') .'/content_admin.inc');
 
// Import the cck content type
drupal_execute("content_copy_import_form", $values); 

permissions_api 5.x-1.1

New features
Unsupported

Two new functions have been added to this version of the module:

  • permissions_grant_all_permissions()
  • permissions_grant_all_permissions_by_module()

The permissions_grant_all_permissions() function grants all defined permissions in the Drupal application to a given role. This is very useful for creating a new role that will function as an admin role.

permissions_api 5.x-1.x-dev

Changed API functions to use more correct terminology "grant" and "revoke"

permissions_api 5.x-1.0

Unsupported

The permissions_api module provides a method for adding and removing permissions from a given role. This module helps with the issue of staging a Drupal site across multiple environments, from development sandbox to production environment.

A specific example includes importing a CCK content type definition via hook_update in a custom module:

// Configure the path to the cck content type definition
$modulepath = drupal_get_path ('module', 'some_module');
$cck_definition_file = $modulepath.'/content_types/front_page_flash.php';
$values['type_name'] = '<create>';
$values['macro'] = file_get_contents($cck_definition_file);
 
include_once( drupal_get_path('module', 'node') .'/content_types.inc');
include_once( drupal_get_path('module', 'content') .'/content_admin.inc');
 
// Import the cck content type
drupal_execute("content_copy_import_form", $values); 

This is great until you decide that you want members of specific roles to be able to do something with this content type. Currently, the only way to grant the permissions is to navigate through the access control page in the admin interface, which is completely unusable if you have a lot of roles and a lot of modules.

This module addresses that problem by providing two functions:

permissions_grant_permissions()
permissions_revoke_permissions()

Subscribe with RSS Subscribe to Releases for Permissions API