Exemple #1
0
 /**
  * Read all privilege records from the object in question and return them
  * accordingly.
  *
  * You need privilege access to get this information (midgard:read (tested during
  * construction) and midgard:privileges) otherwise, the call will fail.
  *
  * @param midcom_core_dbaobject $object The DBA object we're working on
  * @return Array A list of midcom_core_privilege objects or false on failure.
  */
 public static function get_privileges(midcom_core_dbaobject $object)
 {
     if (!$object->can_do('midgard:privileges')) {
         debug_add('Could not query the privileges, permission denied.', MIDCOM_LOG_WARN);
         return false;
     }
     return midcom_core_privilege::get_all_privileges($object->guid);
 }