コード例 #1
0
 /**
  * Sets the group access for a given resource
  * To be used by other plugins
  * @param array $groupsList - Array of groups identifiers (int[])
  * @param int $resource - resource identifier
  * @param string $permission - permission name
  * @param string $plugin_name - name of the plugin calling this method
  * @param string $description - description of the restriction
  * @return boolean True if every group access was set, false if one or more have failed
  **/
 function ugSetGroupsAccess($groupsList, $resource, $permission, $plugin_name, $description)
 {
     $retVal = true;
     userGroups::ugDeleteResource($plugin_name, $resource, $permission);
     foreach ($groupsList as $group) {
         $bol = userGroups::ugSetAccess($group, $resource, $permission, $plugin_name, $description);
         $retVal = $bol && $retVal;
     }
     return $retVal;
 }