u3a-siteworks-development / u3a-siteworks-core

The core plugins
GNU General Public License v2.0
2 stars 1 forks source link

dont filter events when listing for possible deletion protection #113

Closed edwery closed 2 months ago

edwery commented 2 months ago

The list of events returned by list-events was filtered (if the user was not administrator), so the displayed list is only those in the future. However the same function is used to check whether a venue can be deleted, so non-admin users who have edit rights could be allowed to delete venues referenced by events in the past.

Rather than passing the event date out of the function, which would have needed modifications to the array passed out, I have given the function an extra parameter to say whether to apply filtering. For the checking of deletability, this param is false, and for display, the param is true.