/** * Checks read permissions by user for group. * Uses denormalized rights (b_disk_simple_right). * * Be careful^ this is internal method. * @param mixed $user User. * @param int $groupId Id of group. * @internal * @return bool */ public static function canRead($user, $groupId) { $entityType = static::className(); $groupStorage = Storage::buildFromArray(array('ENTITY_ID' => $groupId, 'ENTITY_TYPE' => $entityType)); $proxyType = new static($groupId, $groupStorage); $parameters = array('filter' => array('ENTITY_ID' => (int) $groupId, 'ENTITY_TYPE' => $entityType, 'MODULE_ID' => Driver::INTERNAL_MODULE_ID, 'USE_INTERNAL_RIGHTS' => 1)); $parameters = Driver::getInstance()->getRightsManager()->addRightsCheck($proxyType->getSecurityContextByUser($user), $parameters, array('ROOT_OBJECT_ID', 'USE_INTERNAL_RIGHTS')); return (bool) Storage::getList($parameters)->fetch(); }