Compare commits

..

No commits in common. "ca4cb0ea9eaf68c50cfe39d22560a5ae234436fd" and "2171875ca5533be54f64d7a2e58e753b0d0c63e8" have entirely different histories.

2 changed files with 5 additions and 7 deletions

View File

@ -128,13 +128,8 @@ export function app() {
referer = isArray(req.headers.referer) ? req.headers.referer[0] : (<string>req.headers.referer);
referer = referer.split("?")[0];
}
if (referer && (XFRAME_WHITELIST.indexOf(referer) != -1 || referer.indexOf("/customize-layout") != -1 || referer.indexOf(".d4science.org") != -1 || referer.indexOf(".di.uoa.gr") != -1 || referer.indexOf(".openaire.eu") != -1 )) {
res.header('X-FRAME-OPTIONS', 'allow from ' +req.headers.referer);
res.header('Access-Control-Allow-Origin',req.headers.origin);
res.header('Access-Control-Allow-Methods', 'GET, HEAD, OPTIONS');
res.header('Access-Control-Allow-Headers', 'Cache-control, Expires, Pragma');
res.header('Allow', 'GET, HEAD, OPTIONS');
if (referer && (XFRAME_WHITELIST.indexOf(referer) != -1 || referer.indexOf("/customize-layout") != -1 || referer.indexOf(".d4science.org") != -1)) {
// res.header('X-FRAME-OPTIONS', 'allow from ' +req.headers.referer);
} else {
res.header('X-FRAME-OPTIONS', 'SAMEORIGIN');
}

View File

@ -27,7 +27,9 @@ export class CommunityAccessGuard {
this.communityService.getCommunity(community).pipe(take(1))
]).pipe(
map(([user, communityInfo]) => {
console.log(user, communityInfo)
if (communityInfo) {
console.log(communityInfo.status)
if (communityInfo.isPublic()) {
return true;
} else if (communityInfo.isPrivate()) {
@ -44,6 +46,7 @@ export class CommunityAccessGuard {
return false;
}
if (Session.isPortalAdministrator(user) || Session.isCommunityCurator(user) || Session.isManager('community', community, user) || Session.isSubscribedTo('community', community, user)) {
console.log("user: has access")
return true;
} else {
this.router.navigate(['/user-info'], {