Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Commit

Permalink
Org Managers: Disable org role checkboxes in roles stepper if not adm…
Browse files Browse the repository at this point in the history
…in/org manager

- fixes #4332
  • Loading branch information
richard-cox committed Jun 11, 2020
1 parent ab2dd37 commit 8e0bc42
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export class CfRoleCheckboxComponent implements OnInit, OnDestroy {


@Input() cfGuid: string;
@Input() orgGuid: string;
@Input() spaceGuid: string;
@Input() orgName: string;
@Input() spaceName: string;
Expand All @@ -60,7 +61,6 @@ export class CfRoleCheckboxComponent implements OnInit, OnDestroy {
sub: Subscription;
isOrgRole = false;
disabled = false;
orgGuid: string;

private static hasExistingRole(role: string, roles: CfUserRolesSelected, userGuid: string, orgGuid: string, spaceGuid: string): boolean {
if (roles && roles[userGuid] && roles[userGuid][orgGuid]) {
Expand Down Expand Up @@ -266,7 +266,6 @@ export class CfRoleCheckboxComponent implements OnInit, OnDestroy {
combineLatestOp(this.cfRolesService.newRoles$, users$, canEditRole$, selectUsersIsSetByUsername$),
filter(([existingRoles, newRoles, users, canEditRole, isSetByUsername]) => !!users.length && !!newRoles.orgGuid)
).subscribe(([existingRoles, newRoles, users, canEditRole, isSetByUsername]) => {
this.orgGuid = newRoles.orgGuid;
const { checked, tooltip } = CfRoleCheckboxComponent.getCheckedState(
this.role, users, existingRoles, newRoles, this.orgGuid, this.spaceGuid);
this.checked = checked;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<app-cf-role-checkbox [cfGuid]="row.entity.cfGuid"
[orgGuid]="config.isSpace ? row?.entity.organization?.metadata.guid : row?.metadata.guid"
[orgName]="config.isSpace ? row?.entity.organization?.entity.name : row?.entity.name"
[spaceName]="config.isSpace ? row?.entity.name : null" [spaceGuid]="config.isSpace ? row.metadata.guid : ''"
[role]="config.role"></app-cf-role-checkbox>

0 comments on commit 8e0bc42

Please sign in to comment.