implement Event::canEdit
This commit is contained in:
parent
29fe7f76a2
commit
90e3345440
|
@ -650,6 +650,23 @@ class Event extends ZM_Object {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
function canEdit($u=null) {
|
||||
global $user;
|
||||
if (!$u) $u=$user;
|
||||
if (!$u) {
|
||||
# auth turned on and not logged in
|
||||
return false;
|
||||
}
|
||||
if (!empty($u['MonitorIds']) ) {
|
||||
if (!in_array($this->{'MonitorId'}, explode(',', $u['MonitorIds']))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if ($u['Events'] != 'Edit') {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
} # end class
|
||||
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue