Skip to content
Snippets Groups Projects
Commit f7e75f56 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

connect oer share action with configurable perms, fixes #2638

Closes #2638

Merge request studip/studip!1795
parent 3a66ef5a
No related branches found
No related tags found
No related merge requests found
......@@ -503,7 +503,11 @@ class FileController extends AuthenticatedController
$this->folder = $this->file->getFoldertype();
if (!$this->folder || !$this->folder->isFileEditable($this->file->getId(), $GLOBALS['user']->id)) {
if (
!$this->folder
|| !$this->folder->isFileEditable($this->file->getId(), $GLOBALS['user']->id)
|| !$GLOBALS['perm']->have_perm(Config::get()->OER_PUBLIC_STATUS)
) {
throw new AccessDeniedException();
}
......
......@@ -294,7 +294,11 @@ class StandardFile implements FileType, ArrayAccess, StandardFileInterface
'link-to-clipboard'
);
}
if ($this->isEditable($GLOBALS['user']->id) && Config::get()->OERCAMPUS_ENABLED) {
if (
$this->isEditable($GLOBALS['user']->id)
&& Config::get()->OERCAMPUS_ENABLED
&& $GLOBALS['perm']->have_perm(Config::get()->OER_PUBLIC_STATUS)
) {
$actionMenu->addLink(
URLHelper::getURL('dispatch.php/file/share_oer/' . $this->fileref->id),
_('Im OER Campus veröffentlichen'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment