Commit 7ea92fed authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review

Merge "Group members to always have access to their files (Bug #1267686)"

parents 35510252 15b678c1
......@@ -51,6 +51,15 @@ if ($viewid && $fileid) {
}
}
// If the view is a group view check that the $USER can view it
$author = $file->get('author');
$group = $file->get('group');
if (!empty($author) && !empty($group)) {
if ($USER->can_view_artefact($file)) {
$artefactok = true;
}
}
// The user may be trying to download a file that's not in the view, but which has
// been attached to public feedback on the view
if ($commentid = param_integer('comment', null)) {
......
......@@ -995,6 +995,10 @@ class User {
}
}
if ($a->get('group')) {
if ($USER->get('id') == $a->get('author')) {
// uploader of group file should always have access to it
return true;
}
// Only group artefacts can have artefact_access_role & artefact_access_usr records
return (bool) count_records_sql("SELECT COUNT(*) FROM {artefact_access_role} ar
INNER JOIN {group_member} g ON ar.role = g.role
......
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