Commit 52f4db9c authored by Nigel McNie's avatar Nigel McNie
Browse files

Allow is_admin_for_user to take a userid.


Signed-off-by: default avatarNigel McNie <nigel@catalyst.net.nz>
parent f7094130
......@@ -566,9 +566,18 @@ class User {
}
if ($user instanceof User) {
$userinstitutions = $user->get('institutions');
} else {
}
else if (is_numeric($user)) {
$userinstitutions = load_user_institutions($user);
}
else if (is_object($user)) {
// Should be a row from the usr table
$userinstitutions = load_user_institutions($user->id);
}
else {
throw new SystemException("Invalid argument pass to is_admin_for_user method");
}
foreach ($userinstitutions as $i) {
if ($this->is_institutional_admin($i->institution)) {
return true;
......
Supports Markdown
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