Skip to content
Snippets Groups Projects
Commit af86d5fd authored by Marcus Eibrink-Lunzenauer's avatar Marcus Eibrink-Lunzenauer
Browse files

Check for activation of `CoreDocuments` only in courses/institutes.

Refs #458.
parent 15997c0a
No related branches found
No related tags found
No related merge requests found
...@@ -21,14 +21,16 @@ class Authority ...@@ -21,14 +21,16 @@ class Authority
return false; return false;
} }
$info = \PluginManager::getInstance()->getPluginInfo('CodeDocuments'); if ($resource instanceof \Course || $resource instanceof \Institute) {
if (!\PluginManager::getInstance()->isPluginActivated($info['id'], $resource->getId())) { $info = \PluginManager::getInstance()->getPluginInfo('CoreDocuments');
return false; if (!\PluginManager::getInstance()->isPluginActivated($info['id'], $resource->id)) {
return false;
}
} }
return ($folder = \Folder::findTopFolder($resource->getId())) && return ($folder = \Folder::findTopFolder($resource->id)) &&
($rootFolder = $folder->getTypedFolder()) && ($rootFolder = $folder->getTypedFolder()) &&
$rootFolder->isVisible($user->getId()); $rootFolder->isVisible($user->id);
} }
public static function canShowFolder(User $user, \FolderType $folder) public static function canShowFolder(User $user, \FolderType $folder)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment