Skip to content

Commit e51a826

Browse files
feat(auth): Update authorization checks to use IsComColAdmin feature ID in proper menus (import, export, admin-search and processes)
ref: DSC-2699
1 parent 08f84af commit e51a826

5 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/app/core/data/feature-authorization/feature-id.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export enum FeatureID {
1313
CanManageGroup = 'canManageGroup',
1414
IsCollectionAdmin = 'isCollectionAdmin',
1515
IsCommunityAdmin = 'isCommunityAdmin',
16+
IsComColAdmin = 'isComColAdmin',
1617
CanChangePassword = 'canChangePassword',
1718
CanDownload = 'canDownload',
1819
CanRequestACopy = 'canRequestACopy',

src/app/shared/menu/providers/admin-search.menu.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class AdminSearchMenuProvider extends AbstractMenuProvider {
3232
}
3333

3434
public getSections(): Observable<PartialMenuSection[]> {
35-
return this.authorizationService.isAuthorized(FeatureID.AdministratorOf).pipe(
35+
return this.authorizationService.isAuthorized(FeatureID.IsComColAdmin).pipe(
3636
map((isSiteAdmin) => {
3737
return [
3838
{

src/app/shared/menu/providers/export.menu.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export class ExportMenuProvider extends AbstractExpandableMenuProvider {
5757

5858
public getSubSections(): Observable<PartialMenuSection[]> {
5959
return observableCombineLatest([
60-
this.authorizationService.isAuthorized(FeatureID.AdministratorOf),
60+
this.authorizationService.isAuthorized(FeatureID.IsComColAdmin),
6161
this.scriptDataService.scriptWithNameExistsAndCanExecute(METADATA_EXPORT_SCRIPT_NAME),
6262
]).pipe(
6363
map(([authorized, metadataExportScriptExists]: [boolean, boolean]) => {

src/app/shared/menu/providers/import.menu.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class ImportMenuProvider extends AbstractExpandableMenuProvider {
5353

5454
public getSubSections(): Observable<PartialMenuSection[]> {
5555
return observableCombineLatest([
56-
this.authorizationService.isAuthorized(FeatureID.AdministratorOf),
56+
this.authorizationService.isAuthorized(FeatureID.IsComColAdmin),
5757
this.scriptDataService.scriptWithNameExistsAndCanExecute(METADATA_IMPORT_SCRIPT_NAME),
5858
]).pipe(
5959
map(([authorized, metadataImportScriptExists]) => {

src/app/shared/menu/providers/processes.menu.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class ProcessesMenuProvider extends AbstractMenuProvider {
3434

3535
public getSections(): Observable<PartialMenuSection[]> {
3636
return combineLatest([
37-
this.authorizationService.isAuthorized(FeatureID.AdministratorOf),
37+
this.authorizationService.isAuthorized(FeatureID.IsComColAdmin),
3838
]).pipe(
3939
map(([isSiteAdmin]) => {
4040
return [

0 commit comments

Comments
 (0)