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;
userMenuItems:MenuItem[] = [ new MenuItem("","My profile","","",false,[],[],{}),
new MenuItem("","My links","","/myclaims",false,[],["/myclaims"],{}),
new MenuItem("","Manage all links","","/claims",true,[],["/claims"],{})]
new MenuItem("","My links","","/myclaims",false,[],["/myclaims"],{})]
menuItems:RootMenuItem [] = [
@ -97,8 +96,13 @@ export class AppComponent {
this.properties = this.propertiesService.envSpecific;
this.feedbackmail = this.properties.feedbackmail;
if(Session.isPortalAdministrator()){
this.userMenuItems.push(new MenuItem("","Manage all links","","/claims",false,[],["/claims"],{}));
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,[],[],{}))
}else if(Session.isClaimsCurator()){
this.userMenuItems.push(new MenuItem("","Manage all links","","/claims",false,[],["/claims"],{}));
}
//console.log(this.properties.loginUrl);
}, error => {

View File

@ -1,7 +1,7 @@
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
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 {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard';
@ -9,7 +9,7 @@ import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard';
@NgModule({
imports: [
RouterModule.forChild([
{ path: '', component: OpenaireClaimsAdminComponent, canActivate: [IsRouteEnabled, AdminLoginGuard],
{ path: '', component: OpenaireClaimsAdminComponent, canActivate: [IsRouteEnabled, ClaimsCuratorGuard],
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 { ClaimsAdminRoutingModule } from './claimsAdmin-routing.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 {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard';
@ -15,7 +15,7 @@ import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard';
ClaimsAdminRoutingModule,
ClaimsAdminModule
],
providers:[AdminLoginGuard, PreviousRouteRecorder,IsRouteEnabled],
providers:[ClaimsCuratorGuard, PreviousRouteRecorder,IsRouteEnabled],
declarations: [
OpenaireClaimsAdminComponent
]

View File

@ -7,7 +7,7 @@
"framesAPIURL" : "https://beta.openaire.eu/stats3/",
"statisticsAPIURL" : "http://vatopedi.di.uoa.gr:8080/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/",
"searchResourcesAPIURL" : "https://beta.services.openaire.eu/search/v2/api/resources",
"openCitationsAPIURL" : "https://services.openaire.eu/opencitations/getCitations?id=",