[CST-5065] Admin is unable to reset other user password (cherry pick from DSC-215)

This commit is contained in:
Luca Giamminonni
2021-09-14 10:20:29 +02:00
committed by Davide Negretti
parent e86afacff1
commit 21e78e33e5
2 changed files with 10 additions and 1 deletions

View File

@@ -36,9 +36,13 @@
</button>
</ds-form>
<ds-loading [showMessage]="false" *ngIf="!formGroup"></ds-loading>
<div *ngIf="epersonService.getActiveEPerson() | async">
<h5>{{messagePrefix + '.groupsEPersonIsMemberOf' | translate}}</h5>
<ds-loading [showMessage]="false" *ngIf="!(groups | async)"></ds-loading>
<ds-pagination
*ngIf="(groups | async)?.payload?.totalElements > 0"
[paginationOptions]="config"

View File

@@ -121,7 +121,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
* Observable whether or not the admin is allowed to reset the EPerson's password
* TODO: Initialize the observable once the REST API supports this (currently hardcoded to return false)
*/
canReset$: Observable<boolean> = observableOf(false);
canReset$: Observable<boolean>;
/**
* Observable whether or not the admin is allowed to delete the EPerson
@@ -310,6 +310,11 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
this.canDelete$ = activeEPerson$.pipe(
switchMap((eperson) => this.authorizationService.isAuthorized(FeatureID.CanDelete, hasValue(eperson) ? eperson.self : undefined))
);
this.canReset$ = activeEPerson$.pipe(
switchMap((eperson) => {
return observableOf(true);
})
);
});
}