Commit 4e350c13 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Allow use of group_user_access when logged out



group_user_access returns false when there is no logged-in user.  But
there are times when the code may still want to call this function on
a valid user id and group when there is no active user.

For example, when a logged-out user is looking at a public forum, we
still need to find out whether a poster has permission to publish a
particular image artefact in the post, and being able to use the
group_user_access function is handy in this case.

Change-Id: Id2ef045311fd05220b683a2a2dea4f12cef269f4
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent a2fd943a
......@@ -43,7 +43,7 @@ defined('INTERNAL') || die();
function group_user_access($groupid, $userid=null, $refresh=null) {
static $result;
if (!is_logged_in()) {
if (empty($userid) && !is_logged_in()) {
return false;
}
......
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