Commit df9beac8 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Function to check if user is an institutional admin for a particular institution

parent 103884b7
......@@ -362,10 +362,13 @@ class User {
&& (is_null($role) || $institutions[$institution]->{$role});
}
public function is_institutional_admin() {
public function is_institutional_admin($institution = null) {
$a = $this->get('admininstitutions');
if (is_null($institution)) {
return !empty($a);
}
return isset($a[$institution]);
}
public function set_admin_institutions($institutions) {
$this->set('admininstitutions', array_combine($institutions, $institutions));
......
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