public function getUserPermissions($perm = null) { if (!isset($this->data['users']) || !is_array($this->data['users'])) { return array(); } elseif (!$perm) { return $this->data['users']; } $users = array(); foreach ($this->data['users'] as $user => $uperm) { if ($uperm & $perm) { $users[$user] = $uperm; } } return $users; }
/** * Returns an array of all user permissions on this object. * * @param integer $perm List only users with this permission level. * Defaults to all users. * * @return array All user permissions for this object, indexed by user. */ public function getUserPermissions($perm = null) { $users = parent::getUserPermissions($perm); unset($users[$this->_storage->getOwner()]); return $users; }