Beispiel #1
0
 /**
  * Unsets all privilege on an object .
  *
  * @param midcom_core_dbaobject $object The DBA object we're working on
  * @return bool Indicating success.
  */
 public static function unset_all_privileges(midcom_core_dbaobject $object)
 {
     $privileges = $object->get_privileges();
     if (!$privileges) {
         debug_add('Failed to access the privileges. See above for details.', MIDCOM_LOG_ERROR);
         return false;
     }
     foreach ($privileges as $privilege) {
         if (!$object->unset_privilege($privilege)) {
             debug_add('Failed to drop a privilege record, see debug log for more information, aborting.', MIDCOM_LOG_WARN);
             return false;
         }
     }
     return true;
 }