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: -o-sticky;
position: sticky; position: sticky;
top: 0px; top: 0px;
z-index: 3; z-index: 5;
} }
.toolbar-left { .toolbar-left {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -16,7 +16,12 @@
<!-- Menu --> <!-- Menu -->
<div class="menu-slot"> <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> <mat-icon>more_vert</mat-icon>
</button> </button>
</div> </div>