Merge pull request #4509 from tsiegleauq/more-user-permission-fixes

Fix certain permission checks
This commit is contained in:
Emanuel Schütze 2019-03-14 18:22:29 +01:00 committed by GitHub
commit ccc81df434
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 24 additions and 13 deletions

View File

@ -11,7 +11,7 @@
position: -o-sticky;
position: sticky;
top: 0px;
z-index: 3;
z-index: 5;
}
.toolbar-left {

View File

@ -54,7 +54,7 @@
<mat-header-cell *matHeaderCellDef mat-sort-header>Info</mat-header-cell>
<mat-cell (click)="openEditInfo(item, $event)" *matCellDef="let item">
<div class="info-col-items">
<div *ngIf="item.verboseType">
<div *osPerms="'agenda.can_manage';and:item.verboseType">
<mat-icon>visibility</mat-icon>
{{ item.verboseType | translate }}
</div>

View File

@ -33,12 +33,12 @@ export class AgendaListComponent extends ListViewBaseComponent<ViewItem, Item> i
/**
* Determine the display columns in desktop view
*/
public displayedColumnsDesktop: string[] = ['title', 'info', 'speakers', 'menu'];
public displayedColumnsDesktop: string[] = ['title', 'info', 'speakers'];
/**
* Determine the display columns in mobile view
*/
public displayedColumnsMobile: string[] = ['title', 'speakers', 'menu'];
public displayedColumnsMobile: string[] = ['title', 'speakers'];
public isNumberingAllowed: boolean;
@ -263,6 +263,9 @@ export class AgendaListComponent extends ListViewBaseComponent<ViewItem, Item> i
*/
public getColumnDefinition(): string[] {
let columns = this.vp.isMobile ? this.displayedColumnsMobile : this.displayedColumnsDesktop;
if (this.operator.hasPerms('agenda.can_manage')) {
columns = columns.concat(['menu']);
}
if (this.operator.hasPerms('core.can_manage_projector') && !this.isMultiSelect) {
columns = ['projector'].concat(columns);
}

View File

@ -63,7 +63,7 @@
}
.add-self-buttons {
padding: 0 0 20px 25px;
padding: 20px 0 20px 25px;
}
.speaker-warning {

View File

@ -111,9 +111,11 @@
<mat-icon>mic</mat-icon>
<span translate>List of speakers</span>
</button>
<mat-divider></mat-divider>
<button mat-menu-item class="red-warning-text" (click)="onDeleteButton()">
<mat-icon>delete</mat-icon>
<span translate>Delete</span>
</button>
<div *osPerms="'agenda.can_manage'">
<mat-divider></mat-divider>
<button mat-menu-item class="red-warning-text" (click)="onDeleteButton()">
<mat-icon>delete</mat-icon>
<span translate>Delete</span>
</button>
</div>
</mat-menu>

View File

@ -230,9 +230,9 @@ export class TopicDetailComponent extends BaseViewComponent {
public isAllowed(action: string): boolean {
switch (action) {
case 'see':
return this.operator.hasPerms('agenda.can_manage');
case 'edit':
return this.operator.hasPerms('agenda.can_see');
case 'edit':
return this.operator.hasPerms('agenda.can_manage');
case 'default':
return false;
}

View File

@ -24,6 +24,7 @@ mat-form-field {
right: 0;
margin-left: auto;
margin-right: auto;
z-index: 2;
}
}

View File

@ -16,7 +16,12 @@
<!-- Menu -->
<div class="menu-slot">
<button type="button" mat-icon-button *ngIf="isAllowed('changePersonal')" [matMenuTriggerFor]="userExtraMenu">
<button
type="button"
mat-icon-button
*ngIf="isAllowed('changePersonal') && isAllowed('changePassword')"
[matMenuTriggerFor]="userExtraMenu"
>
<mat-icon>more_vert</mat-icon>
</button>
</div>