fix #189: hide Group ID for unregistered users

This commit is contained in:
Davide Alberani 2017-12-02 16:54:03 +01:00
parent e754203256
commit a48e256530
2 changed files with 3 additions and 1 deletions

View file

@ -78,7 +78,7 @@
<span class="input-group-addon min100">{{'Where' | translate}}</span>
<input type="text" class="form-control" placeholder="{{'Where' | translate}}" ng-model="event.where">
</div>
<div class="input-group input-group top5">
<div ng-if="!eventFormDisabled" class="input-group input-group top5">
<span class="input-group-addon min100">{{'Group ID' | translate}}</span>
<input type="text" class="form-control" placeholder="{{'Used to share persons amongst multiple events. Must be hard to guess (if empty, will be autogenerated)' | translate}}" ng-model="event.group_id">
</div>

View file

@ -632,6 +632,8 @@ class EventsHandler(CollectionHandler):
self._check_number_of_tickets(event)
except InputException:
event['no_tickets_for_sale'] = True
if not self.has_permission('event|write'):
event['group_id'] = ''
if not self.has_permission('tickets-all|read'):
event['tickets'] = []
return event