You are here

function oa_access_get_group_permissions_combined in Open Atrium Core 7.2

Gets a combined list of the permissions that a list of groups can perform.

This doesn't obey the permissions 'combine' property - it's just a straight forward union of all the permissions from each Group or Team.

Parameters

array: An array of Group or Team nids.

Return value

array

array(
  'one permission' => TRUE,
  'an other permission' => TRUE,
);

Which signifies that the combined permissions of the given groups include 'one permission' and 'an other permission'.

See also

oa_access_get_group_permissions()

oa_access_user_groups()

oa_access_user_teams()

3 calls to oa_access_get_group_permissions_combined()
oa_access in modules/oa_access/oa_access.module
Determines if the user has a permission.
OpenAtriumAccessTestCase::testCombinedGroupPermissions in modules/oa_access/tests/oa_access.test
_oa_access_is_overridden in modules/oa_access/oa_access.module
Helper function to determine if a permission is overridden by Group or Team.

File

modules/oa_access/oa_access.module, line 533
Code for the Open Atrium Access module.

Code

function oa_access_get_group_permissions_combined($groups) {
  $return = array();
  foreach (oa_access_get_group_permissions($groups) as $gid => $modules) {
    foreach ($modules as $perms) {
      foreach ($perms as $name) {
        $return[$name] = TRUE;
      }
    }
  }
  return $return;
}