Point of order only for agenda.can_be_speaker
This commit is contained in:
parent
e75bdeb0f7
commit
a9045b6a1c
@ -177,21 +177,19 @@
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="add-self-buttons">
|
||||
<div class="add-self-buttons" *osPerms="'agenda.can_be_speaker'">
|
||||
<!-- Add me and remove me if OP has correct permission -->
|
||||
|
||||
<button
|
||||
*osPerms="'agenda.can_be_speaker'; and: !isOpInWaitlist()"
|
||||
*ngIf="!isOpInWaitlist()"
|
||||
mat-stroked-button
|
||||
[disabled]="closed || !canAddSelf"
|
||||
[disabled]="closed || !canAddDueToPresence"
|
||||
(click)="addUserAsNewSpeaker()"
|
||||
>
|
||||
<mat-icon>add</mat-icon>
|
||||
<span>{{ 'Add me' | translate }}</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
*osPerms="'agenda.can_be_speaker'; and: isOpInWaitlist()"
|
||||
*ngIf="isOpInWaitlist()"
|
||||
mat-stroked-button
|
||||
[disabled]="closed"
|
||||
(click)="removeSpeaker()"
|
||||
|
@ -58,7 +58,11 @@ export class ListOfSpeakersContentComponent extends BaseViewComponentDirective i
|
||||
|
||||
public showFistContributionHint: boolean;
|
||||
|
||||
public showPointOfOrders: boolean;
|
||||
public get showPointOfOrders(): boolean {
|
||||
return this.pointOfOrderEnabled && this.canAddDueToPresence;
|
||||
}
|
||||
|
||||
private pointOfOrderEnabled: boolean;
|
||||
|
||||
public get title(): string {
|
||||
return this.viewListOfSpeakers?.getTitle();
|
||||
@ -72,7 +76,7 @@ export class ListOfSpeakersContentComponent extends BaseViewComponentDirective i
|
||||
return this.operator.hasPerms(this.permission.agendaCanManageListOfSpeakers);
|
||||
}
|
||||
|
||||
public get canAddSelf(): boolean {
|
||||
public get canAddDueToPresence(): boolean {
|
||||
return !this.config.instant('agenda_present_speakers_only') || this.operator.user.is_present;
|
||||
}
|
||||
|
||||
@ -144,8 +148,8 @@ export class ListOfSpeakersContentComponent extends BaseViewComponentDirective i
|
||||
this.showFistContributionHint = show;
|
||||
}),
|
||||
// observe point of order settings
|
||||
this.config.get<boolean>('agenda_enable_point_of_order_speakers').subscribe(show => {
|
||||
this.showPointOfOrders = show;
|
||||
this.config.get<boolean>('agenda_enable_point_of_order_speakers').subscribe(enabled => {
|
||||
this.pointOfOrderEnabled = enabled;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
@ -338,10 +338,9 @@ class ListOfSpeakersViewSet(
|
||||
# Check permissions and other conditions. Get user instance.
|
||||
if user_id is None:
|
||||
# Add oneself
|
||||
if not point_of_order and not has_perm(
|
||||
self.request.user, "agenda.can_be_speaker"
|
||||
):
|
||||
if not has_perm(self.request.user, "agenda.can_be_speaker"):
|
||||
self.permission_denied(request)
|
||||
|
||||
# even if the list is closed, point of order has to be accepted
|
||||
if not point_of_order and list_of_speakers.closed:
|
||||
raise ValidationError({"detail": "The list of speakers is closed."})
|
||||
|
Loading…
Reference in New Issue
Block a user