Change guard in claims administration page use ClaimsCuratorGuard
	In app component add manage claims links only for admins and claims curators


git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@54935 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2019-02-28 15:30:25 +00:00
parent f030a21962
commit 11e46dee59
4 changed files with 11 additions and 7 deletions

View File

@ -41,8 +41,7 @@ export class AppComponent {
clientLoad = 0; clientLoad = 0;
userMenuItems:MenuItem[] = [ new MenuItem("","My profile","","",false,[],[],{}), userMenuItems:MenuItem[] = [ new MenuItem("","My profile","","",false,[],[],{}),
new MenuItem("","My links","","/myclaims",false,[],["/myclaims"],{}), new MenuItem("","My links","","/myclaims",false,[],["/myclaims"],{})]
new MenuItem("","Manage all links","","/claims",true,[],["/claims"],{})]
menuItems:RootMenuItem [] = [ menuItems:RootMenuItem [] = [
@ -97,8 +96,13 @@ export class AppComponent {
this.properties = this.propertiesService.envSpecific; this.properties = this.propertiesService.envSpecific;
this.feedbackmail = this.properties.feedbackmail; this.feedbackmail = this.properties.feedbackmail;
if(Session.isPortalAdministrator()){ if(Session.isPortalAdministrator()){
this.userMenuItems.push(new MenuItem("","Manage all links","","/claims",false,[],["/claims"],{}));
this.userMenuItems.push(new MenuItem("","Manage helptexts", this.userMenuItems.push(new MenuItem("","Manage helptexts",
((this.properties.environment == "beta")?"https://beta.admin.connect.openaire.eu":"https://admin.explore.openaire.eu")+"/dashboard?communityId=openaire","",true,[],[],{})) ((this.properties.environment == "beta")?"https://beta.admin.connect.openaire.eu":"https://admin.explore.openaire.eu")+"/dashboard?communityId=openaire","",true,[],[],{}))
}else if(Session.isClaimsCurator()){
this.userMenuItems.push(new MenuItem("","Manage all links","","/claims",false,[],["/claims"],{}));
} }
//console.log(this.properties.loginUrl); //console.log(this.properties.loginUrl);
}, error => { }, error => {

View File

@ -1,7 +1,7 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
import { OpenaireClaimsAdminComponent } from './claimsAdmin.component'; import { OpenaireClaimsAdminComponent } from './claimsAdmin.component';
import{ AdminLoginGuard} from '../../openaireLibrary/login/adminLoginGuard.guard'; import{ ClaimsCuratorGuard} from '../../openaireLibrary/login/claimsCuratorGuard.guard';
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard'; import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard';
@ -9,7 +9,7 @@ import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard';
@NgModule({ @NgModule({
imports: [ imports: [
RouterModule.forChild([ RouterModule.forChild([
{ path: '', component: OpenaireClaimsAdminComponent, canActivate: [IsRouteEnabled, AdminLoginGuard], { path: '', component: OpenaireClaimsAdminComponent, canActivate: [IsRouteEnabled, ClaimsCuratorGuard],
data: {redirect: '/error', community : 'openaire'}, canDeactivate: [PreviousRouteRecorder]}]) data: {redirect: '/error', community : 'openaire'}, canDeactivate: [PreviousRouteRecorder]}])
] ]
}) })

View File

@ -4,7 +4,7 @@ import { SharedModule } from '../../shared/shared.module';
import { OpenaireClaimsAdminComponent } from './claimsAdmin.component'; import { OpenaireClaimsAdminComponent } from './claimsAdmin.component';
import { ClaimsAdminRoutingModule } from './claimsAdmin-routing.module'; import { ClaimsAdminRoutingModule } from './claimsAdmin-routing.module';
import{ClaimsAdminModule } from '../../openaireLibrary/claims/claimsAdmin/claimsAdmin.module'; import{ClaimsAdminModule } from '../../openaireLibrary/claims/claimsAdmin/claimsAdmin.module';
import {AdminLoginGuard} from '../../openaireLibrary/login/adminLoginGuard.guard'; import{ ClaimsCuratorGuard} from '../../openaireLibrary/login/claimsCuratorGuard.guard';
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard'; import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard';
@ -15,7 +15,7 @@ import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard';
ClaimsAdminRoutingModule, ClaimsAdminRoutingModule,
ClaimsAdminModule ClaimsAdminModule
], ],
providers:[AdminLoginGuard, PreviousRouteRecorder,IsRouteEnabled], providers:[ClaimsCuratorGuard, PreviousRouteRecorder,IsRouteEnabled],
declarations: [ declarations: [
OpenaireClaimsAdminComponent OpenaireClaimsAdminComponent
] ]

View File

@ -7,7 +7,7 @@
"framesAPIURL" : "https://beta.openaire.eu/stats3/", "framesAPIURL" : "https://beta.openaire.eu/stats3/",
"statisticsAPIURL" : "http://vatopedi.di.uoa.gr:8080/stats/", "statisticsAPIURL" : "http://vatopedi.di.uoa.gr:8080/stats/",
"statisticsFrameAPIURL":"https://beta.openaire.eu/stats/", "statisticsFrameAPIURL":"https://beta.openaire.eu/stats/",
"claimsAPIURL" : "http://duffy.di.uoa.gr:8080/dnet-claims-service-2.0.0-SNAPSHOT/rest/claimsService/", "claimsAPIURL" : "http://scoobydoo.di.uoa.gr:8080/dnet-claims-service-2.0.0-SNAPSHOT/rest/claimsService/",
"searchAPIURLLAst" : "https://beta.services.openaire.eu/search/v2/api/", "searchAPIURLLAst" : "https://beta.services.openaire.eu/search/v2/api/",
"searchResourcesAPIURL" : "https://beta.services.openaire.eu/search/v2/api/resources", "searchResourcesAPIURL" : "https://beta.services.openaire.eu/search/v2/api/resources",
"openCitationsAPIURL" : "https://services.openaire.eu/opencitations/getCitations?id=", "openCitationsAPIURL" : "https://services.openaire.eu/opencitations/getCitations?id=",