How to hide Filters button for restricted users

Forum for questions and support relating to the 1.30.x releases only.
Locked
stefp
Posts: 6
Joined: Fri Nov 29, 2013 12:59 pm

How to hide Filters button for restricted users

Post by stefp »

Hi ,I have Zoneminder 1.30.2 on Ubuntu 14.04 LTS ,and add user that can only view (Stream -View ,Events -View ,Control - None ,Monitors - None,Groups - None ,System - None ) ,but button Filters is enable and can be used .I want to hide/disable that button ,haw ?
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: How to hide Filters button for restricted users

Post by rockedge »

Hiding the filter button! First time I even thought of this feature......one that really makes sense. I do not know of a way without modifying the zoneminder code directly but I never really looked! I will test around and see what it will take to hide the Filters button and access to the filters based on permissions. Really should be noted in the Features Suggestion thread.
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: How to hide Filters button for restricted users

Post by knight-of-ni »

The filter feature in ZoneMinder is tied to the View Events permission.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
stefp
Posts: 6
Joined: Fri Nov 29, 2013 12:59 pm

Re: How to hide Filters button for restricted users

Post by stefp »

Yes ,right .But I want user can view Events too ,not only Stream (live view) . But if is impossible and that will work .
Or if is possible if Stream is - View ,Filters to be disabled ?
Thank you.
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: How to hide Filters button for restricted users

Post by rockedge »

add a new option for Filters->View/none ?
stefp
Posts: 6
Joined: Fri Nov 29, 2013 12:59 pm

Re: How to hide Filters button for restricted users

Post by stefp »

May be is simple to make button - Filters disabled when option Stream is - View .
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: How to hide Filters button for restricted users

Post by rockedge »

I have a modification that seems to work on my test system. When a user has Stream ="View" and Events="View" selected and everything else set to "none" there is no access to the filters. change Events="Edit" too allow access.
on my Ubuntu based system --->
open /usr/share/zoneminder/www/skins/classic/views/filter.php

around line 22 find :

Code: Select all

if ( !canView( 'Events' ))
and replace with :

Code: Select all

if ( canView( 'Stream') and canView( 'Events' ) and !canEdit( 'Events'))
It needs some testing.
stefp
Posts: 6
Joined: Fri Nov 29, 2013 12:59 pm

Re: How to hide Filters button for restricted users

Post by stefp »

On my system work too ,thank you .
Locked