sheltermanager / asm3

Animal Shelter Manager
GNU General Public License v3.0
105 stars 65 forks source link

Animal and Person view roles #1479

Open bobintetley opened 3 weeks ago

bobintetley commented 3 weeks ago

Similar to how we do for incidents, allow an option to turn on extra view permissions for animals and people.

This would allow for a role dropdown on animals and people records, where users can assign the only roles that are allowed to view that specific record.

A lot of people have asked for this over the years.

bobintetley commented 3 weeks ago

The options should go under Remove->System->Remove fine-grained animal permissions, and Remove fine-grained person permissions (both set by default)

bobintetley commented 3 weeks ago

Like animalcontrol.py, animal.py and person.py will need their own reduce_find_results functions that are called by their find routines to throw away rows the user does not have permission to view. shelterview will need to call the animal one as well.

animal.py currently has a function get_location_filter_where_clause that does most of this, but it does it by some difficult logic and writing SQL. It would be a lot simpler if it were reimplemented as a reduce type function that throws away unwanted records the way that animalcontrol does.