Browse Source

Restrict restricted view and manage permission to MCP

pull/7783/head
Thomas Kaul 1 month ago
parent
commit
26bc8bd48c
  1. 21
      apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.component.ts
  2. 2
      apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.html

21
apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.component.ts

@ -196,15 +196,22 @@ export class GfCreateOrUpdateAccessDialogComponent implements OnInit {
// Narrow the permission to the scopes which the type permits, because
// an access which is not granted to a user never exposes the monetary
// values and a public access never changes data
this.accessForm.get('accessLevel')?.setValue(
getAccessLevel(
getScopesOfAccess({
scopes: getScopesOfAccessLevel(this.accessLevel),
type: accessType
})
)
const accessLevelOfType = getAccessLevel(
getScopesOfAccess({
scopes: getScopesOfAccessLevel(this.accessLevel),
type: accessType
})
);
this.accessForm
.get('accessLevel')
?.setValue(
accessType === 'PRIVATE' &&
accessLevelOfType === 'CREATE_READ_RESTRICTED_UPDATE_DELETE'
? 'CREATE_READ_UPDATE_DELETE'
: accessLevelOfType
);
if (!canApplyFiltersToAccess({ type: accessType })) {
this.accessForm.get('filters')?.setValue(null);
}

2
apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.html

@ -82,7 +82,7 @@
<mat-option value="READ_RESTRICTED">
<gf-access-level-icon accessLevel="READ_RESTRICTED" />
</mat-option>
@if (!isPublicAccess) {
@if (accessForm.get('type')?.value === 'MCP') {
<mat-option
value="CREATE_READ_RESTRICTED_UPDATE_DELETE"
[disabled]="!canGrantWriteAccess"

Loading…
Cancel
Save