[Library | Trunk]: Session methods change condition if user is undefined not not equal to null, to avoid error on server

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58873 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2020-06-10 09:21:12 +00:00
parent 4b3467b621
commit 0c7953b710
1 changed files with 6 additions and 6 deletions

View File

@ -51,32 +51,32 @@ export class Session{
//Methods to check roles
public static isClaimsCurator(user: User): boolean {
return user !== null &&
return user &&
user.role.indexOf('urn:geant:openaire.eu:group:Curator+-+Claim#aai.openaire.eu') !== -1;
}
public static isCommunityCurator(user: User): boolean {
return user !== null &&
return user &&
user.role.indexOf('urn:geant:openaire.eu:group:Curator+-+Community#aai.openaire.eu') !== -1;
}
public static isMonitorCurator(user: User): boolean {
return user !== null &&
return user &&
(user.role.indexOf('urn:geant:openaire.eu:group:Expert+-+Funder#aai.openaire.eu') !== -1 || user.role.indexOf('urn:geant:openaire.eu:group:Curator+-+Funder#aai.openaire.eu') !== -1);
}
public static isPortalAdministrator(user: User): boolean {
return user !== null &&
return user &&
user.role.indexOf('urn:geant:openaire.eu:group:Portal+Administrator#aai.openaire.eu') !== -1;
}
public static isUserManager(user: User): boolean {
return user !== null &&
return user &&
user.role.indexOf('urn:geant:openaire.eu:group:User+Manager#aai.openaire.eu') !== -1;
}
public static isRegisteredUser(user: User): boolean {
return user !== null &&
return user &&
user.role.indexOf('urn:geant:openaire.eu:group:Registered+User#aai.openaire.eu') !== -1;
}