Commit 8c982568 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Bug 1122602: Error message for site image not public in block"

parents 6f307068 e977a8ac
......@@ -637,22 +637,28 @@ abstract class ArtefactTypeFileBase extends ArtefactType {
$item->size = ArtefactTypeFile::short_size($item->size, true);
}
if ($group) {
// site public files
if ($institution == 'mahara' && ArtefactTypeFolder::admin_public_folder_id() == $parentfolderid) {
$item->can_edit = 0;
$item->can_view = 1;
$item->can_republish = 1;
}
else if (!empty($item->author) && $item->author == $USER->get('id')) {
$item->can_edit = 1;
$item->can_view = 1;
$item->can_republish = 1;
}
else {
$item->can_edit = $can_edit_parent && $item->can_edit;
$item->can_view = $can_view_parent && $item->can_view;
$item->can_republish = $can_view_parent && $item->can_republish;
}
if ( $institution == 'mahara' && $USER->get('admin')) {
//site files inside and outside public folder (only admin user)
$item->can_edit = 1;
$item->can_view = 1;
$item->can_republish = 1;
}
else if ($institution == 'mahara' && ArtefactTypeFolder::admin_public_folder_id() == $parentfolderid) {
// site public files, not admin user
$item->can_edit = 0;
$item->can_view = 1;
$item->can_republish = 1;
}
else if (!empty($item->author) && $item->author == $USER->get('id')) {
$item->can_edit = 1;
$item->can_view = 1;
$item->can_republish = 1;
}
else {
$item->can_edit = $can_edit_parent && $item->can_edit;
$item->can_view = $can_view_parent && $item->can_view;
$item->can_republish = $can_view_parent && $item->can_republish;
}
}
if (!empty($item->author)) {
if ($group && $item->author == $USER->get('id')) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment