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

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

parents a8ee38a4 85967a3f
......@@ -48,6 +48,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)) {
......
......@@ -1017,6 +1017,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