Allow users with Monitors::View to generate and cancel events

This commit is contained in:
Isaac Connor 2021-03-12 09:26:56 -05:00
parent 6682ec7da5
commit c9170a87b2
1 changed files with 2 additions and 2 deletions

View File

@ -179,11 +179,11 @@ bool ValidateAccess(User *user, int mon_id, int function) {
if ( user->getEvents() < User::PERM_VIEW )
allowed = false;
}
if ( function & (ZMU_ZONES|ZMU_QUERY|ZMU_LIST) ) {
if ( function & (ZMU_ZONES|ZMU_QUERY|ZMU_LIST|ZMU_ALARM|ZMU_CANCEL) ) {
if ( user->getMonitors() < User::PERM_VIEW )
allowed = false;
}
if ( function & (ZMU_ALARM|ZMU_NOALARM|ZMU_CANCEL|ZMU_RELOAD|ZMU_ENABLE|ZMU_DISABLE|ZMU_SUSPEND|ZMU_RESUME|ZMU_BRIGHTNESS|ZMU_CONTRAST|ZMU_HUE|ZMU_COLOUR) ) {
if ( function & (ZMU_NOALARM|ZMU_RELOAD|ZMU_ENABLE|ZMU_DISABLE|ZMU_SUSPEND|ZMU_RESUME|ZMU_BRIGHTNESS|ZMU_CONTRAST|ZMU_HUE|ZMU_COLOUR) ) {
if ( user->getMonitors() < User::PERM_EDIT )
allowed = false;
}