mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
77205: Separate access control section in admin sidebar
This commit is contained in:
@@ -79,6 +79,7 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit {
|
|||||||
this.createSiteAdministratorMenuSections();
|
this.createSiteAdministratorMenuSections();
|
||||||
this.createExportMenuSections();
|
this.createExportMenuSections();
|
||||||
this.createImportMenuSections();
|
this.createImportMenuSections();
|
||||||
|
this.createAccessControlMenuSections();
|
||||||
super.ngOnInit();
|
super.ngOnInit();
|
||||||
this.sidebarWidth = this.variableService.getVariable('sidebarItemsWidth');
|
this.sidebarWidth = this.variableService.getVariable('sidebarItemsWidth');
|
||||||
this.authService.isAuthenticated()
|
this.authService.isAuthenticated()
|
||||||
@@ -436,51 +437,6 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit {
|
|||||||
createSiteAdministratorMenuSections() {
|
createSiteAdministratorMenuSections() {
|
||||||
this.authorizationService.isAuthorized(FeatureID.AdministratorOf).subscribe((authorized) => {
|
this.authorizationService.isAuthorized(FeatureID.AdministratorOf).subscribe((authorized) => {
|
||||||
const menuList = [
|
const menuList = [
|
||||||
/* Access Control */
|
|
||||||
{
|
|
||||||
id: 'access_control',
|
|
||||||
active: false,
|
|
||||||
visible: authorized,
|
|
||||||
model: {
|
|
||||||
type: MenuItemType.TEXT,
|
|
||||||
text: 'menu.section.access_control'
|
|
||||||
} as TextMenuItemModel,
|
|
||||||
icon: 'key',
|
|
||||||
index: 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'access_control_people',
|
|
||||||
parentID: 'access_control',
|
|
||||||
active: false,
|
|
||||||
visible: authorized,
|
|
||||||
model: {
|
|
||||||
type: MenuItemType.LINK,
|
|
||||||
text: 'menu.section.access_control_people',
|
|
||||||
link: '/admin/access-control/epeople'
|
|
||||||
} as LinkMenuItemModel,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'access_control_groups',
|
|
||||||
parentID: 'access_control',
|
|
||||||
active: false,
|
|
||||||
visible: authorized,
|
|
||||||
model: {
|
|
||||||
type: MenuItemType.LINK,
|
|
||||||
text: 'menu.section.access_control_groups',
|
|
||||||
link: '/admin/access-control/groups'
|
|
||||||
} as LinkMenuItemModel,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'access_control_authorizations',
|
|
||||||
parentID: 'access_control',
|
|
||||||
active: false,
|
|
||||||
visible: authorized,
|
|
||||||
model: {
|
|
||||||
type: MenuItemType.LINK,
|
|
||||||
text: 'menu.section.access_control_authorizations',
|
|
||||||
link: ''
|
|
||||||
} as LinkMenuItemModel,
|
|
||||||
},
|
|
||||||
/* Admin Search */
|
/* Admin Search */
|
||||||
{
|
{
|
||||||
id: 'admin_search',
|
id: 'admin_search',
|
||||||
@@ -564,6 +520,65 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create menu sections dependent on whether or not the current user can manage access control groups
|
||||||
|
*/
|
||||||
|
createAccessControlMenuSections() {
|
||||||
|
this.authorizationService.isAuthorized(FeatureID.CanManageGroups).subscribe((authorized) => {
|
||||||
|
const menuList = [
|
||||||
|
/* Access Control */
|
||||||
|
{
|
||||||
|
id: 'access_control',
|
||||||
|
active: false,
|
||||||
|
visible: authorized,
|
||||||
|
model: {
|
||||||
|
type: MenuItemType.TEXT,
|
||||||
|
text: 'menu.section.access_control'
|
||||||
|
} as TextMenuItemModel,
|
||||||
|
icon: 'key',
|
||||||
|
index: 4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'access_control_people',
|
||||||
|
parentID: 'access_control',
|
||||||
|
active: false,
|
||||||
|
visible: authorized,
|
||||||
|
model: {
|
||||||
|
type: MenuItemType.LINK,
|
||||||
|
text: 'menu.section.access_control_people',
|
||||||
|
link: '/access-control/epeople'
|
||||||
|
} as LinkMenuItemModel,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'access_control_groups',
|
||||||
|
parentID: 'access_control',
|
||||||
|
active: false,
|
||||||
|
visible: authorized,
|
||||||
|
model: {
|
||||||
|
type: MenuItemType.LINK,
|
||||||
|
text: 'menu.section.access_control_groups',
|
||||||
|
link: '/access-control/groups'
|
||||||
|
} as LinkMenuItemModel,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'access_control_authorizations',
|
||||||
|
parentID: 'access_control',
|
||||||
|
active: false,
|
||||||
|
visible: authorized,
|
||||||
|
model: {
|
||||||
|
type: MenuItemType.LINK,
|
||||||
|
text: 'menu.section.access_control_authorizations',
|
||||||
|
link: ''
|
||||||
|
} as LinkMenuItemModel,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
menuList.forEach((menuSection) => this.menuService.addSection(this.menuID, Object.assign(menuSection, {
|
||||||
|
shouldPersistOnRouteChange: true,
|
||||||
|
})));
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method to change this.collapsed to false when the slide animation ends and is sliding open
|
* Method to change this.collapsed to false when the slide animation ends and is sliding open
|
||||||
* @param event The animation event
|
* @param event The animation event
|
||||||
|
@@ -1,11 +1,7 @@
|
|||||||
import { URLCombiner } from '../core/url-combiner/url-combiner';
|
import { URLCombiner } from '../core/url-combiner/url-combiner';
|
||||||
|
import { getAccessControlModuleRoute } from '../app-routing-paths';
|
||||||
|
|
||||||
export const GROUP_EDIT_PATH = 'groups';
|
export const GROUP_EDIT_PATH = 'groups';
|
||||||
export const ACCESS_CONTROL_MODULE_PATH = 'access-control';
|
|
||||||
|
|
||||||
export function getAccessControlModuleRoute() {
|
|
||||||
return `/${ACCESS_CONTROL_MODULE_PATH}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getGroupEditRoute(id: string) {
|
export function getGroupEditRoute(id: string) {
|
||||||
return new URLCombiner(getAccessControlModuleRoute(), GROUP_EDIT_PATH, id).toString();
|
return new URLCombiner(getAccessControlModuleRoute(), GROUP_EDIT_PATH, id).toString();
|
||||||
|
@@ -71,3 +71,9 @@ export const INFO_MODULE_PATH = 'info';
|
|||||||
export function getInfoModulePath() {
|
export function getInfoModulePath() {
|
||||||
return `/${INFO_MODULE_PATH}`;
|
return `/${INFO_MODULE_PATH}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const ACCESS_CONTROL_MODULE_PATH = 'access-control';
|
||||||
|
|
||||||
|
export function getAccessControlModuleRoute() {
|
||||||
|
return `/${ACCESS_CONTROL_MODULE_PATH}`;
|
||||||
|
}
|
||||||
|
@@ -9,4 +9,5 @@ export enum FeatureID {
|
|||||||
WithdrawItem = 'withdrawItem',
|
WithdrawItem = 'withdrawItem',
|
||||||
ReinstateItem = 'reinstateItem',
|
ReinstateItem = 'reinstateItem',
|
||||||
EPersonRegistration = 'epersonRegistration',
|
EPersonRegistration = 'epersonRegistration',
|
||||||
|
CanManageGroups = 'canManageGroups',
|
||||||
}
|
}
|
||||||
|
@@ -31,8 +31,8 @@ import { RequestService } from '../../core/data/request.service';
|
|||||||
import { NotificationsService } from '../notifications/notifications.service';
|
import { NotificationsService } from '../notifications/notifications.service';
|
||||||
import { dateToString, stringToNgbDateStruct } from '../date.util';
|
import { dateToString, stringToNgbDateStruct } from '../date.util';
|
||||||
import { followLink } from '../utils/follow-link-config.model';
|
import { followLink } from '../utils/follow-link-config.model';
|
||||||
import { ADMIN_MODULE_PATH } from '../../app-routing-paths';
|
import { ACCESS_CONTROL_MODULE_PATH, ADMIN_MODULE_PATH } from '../../app-routing-paths';
|
||||||
import { ACCESS_CONTROL_MODULE_PATH, GROUP_EDIT_PATH } from '../../access-control/access-control-routing-paths';
|
import { GROUP_EDIT_PATH } from '../../access-control/access-control-routing-paths';
|
||||||
|
|
||||||
interface ResourcePolicyCheckboxEntry {
|
interface ResourcePolicyCheckboxEntry {
|
||||||
id: string;
|
id: string;
|
||||||
|
Reference in New Issue
Block a user