Skip to content

Commit

Permalink
Correct permissions (#759)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-rubenstein authored Apr 25, 2018
1 parent 61cc751 commit 4865d73
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ui/src/app/views/workspace-nav-bar/component.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<button class="btn btn-primary btn-top">Notebooks</button>
-->
<span role="tooltip" aria-haspopup="true" class="tooltip tooltip-md tooltip-top-right">
<clr-button class="btn btn-primary btn-top" [class.awaiting-review]="awaitingReview" [disabled]="awaitingReview"
<clr-button class="btn btn-primary btn-top" [class.awaiting-review]="awaitingReview" [disabled]="awaitingReview || !writePermission"
[routerLink]="['/workspace', wsNamespace, wsId, 'cohorts', 'build']">
Cohort Builder
</clr-button>
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/views/workspace/component.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h2>{{workspace.name}}</h2>
<div>
<span role="tooltip" aria-haspopup="true" class="tooltip tooltip-md tooltip-top-left">
<button *ngIf="tabOpen===Tabs.Cohorts" class="btn btn-primary btn-create"
[class.awaiting-review]="awaitingReview" [disabled]="awaitingReview" (click)="buildCohort()">
[class.awaiting-review]="awaitingReview" [disabled]="awaitingReview || !writePermission" (click)="buildCohort()">
+ Add a Cohort
</button>
<span *ngIf="awaitingReview" class="tooltip-content">Workspace is awaiting review</span>
Expand Down
5 changes: 5 additions & 0 deletions ui/src/app/views/workspace/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,4 +369,9 @@ export class WorkspaceComponent implements OnInit, OnDestroy {
const asDate = new Date(this.workspace.lastModifiedTime);
return asDate.toDateString();
}

get writePermission(): boolean {
return this.accessLevel === WorkspaceAccessLevel.OWNER
|| this.accessLevel === WorkspaceAccessLevel.WRITER;
}
}

0 comments on commit 4865d73

Please sign in to comment.