Compare commits
4 Commits
2171875ca5
...
ca4cb0ea9e
Author | SHA1 | Date |
---|---|---|
argirok | ca4cb0ea9e | |
argirok | 6b634f93e0 | |
argirok | 1aa3b54a1a | |
argirok | 1f29b3200f |
|
@ -128,8 +128,13 @@ export function app() {
|
||||||
referer = isArray(req.headers.referer) ? req.headers.referer[0] : (<string>req.headers.referer);
|
referer = isArray(req.headers.referer) ? req.headers.referer[0] : (<string>req.headers.referer);
|
||||||
referer = referer.split("?")[0];
|
referer = referer.split("?")[0];
|
||||||
}
|
}
|
||||||
if (referer && (XFRAME_WHITELIST.indexOf(referer) != -1 || referer.indexOf("/customize-layout") != -1 || referer.indexOf(".d4science.org") != -1)) {
|
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('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');
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
res.header('X-FRAME-OPTIONS', 'SAMEORIGIN');
|
res.header('X-FRAME-OPTIONS', 'SAMEORIGIN');
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,9 +27,7 @@ export class CommunityAccessGuard {
|
||||||
this.communityService.getCommunity(community).pipe(take(1))
|
this.communityService.getCommunity(community).pipe(take(1))
|
||||||
]).pipe(
|
]).pipe(
|
||||||
map(([user, communityInfo]) => {
|
map(([user, communityInfo]) => {
|
||||||
console.log(user, communityInfo)
|
|
||||||
if (communityInfo) {
|
if (communityInfo) {
|
||||||
console.log(communityInfo.status)
|
|
||||||
if (communityInfo.isPublic()) {
|
if (communityInfo.isPublic()) {
|
||||||
return true;
|
return true;
|
||||||
} else if (communityInfo.isPrivate()) {
|
} else if (communityInfo.isPrivate()) {
|
||||||
|
@ -46,7 +44,6 @@ export class CommunityAccessGuard {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (Session.isPortalAdministrator(user) || Session.isCommunityCurator(user) || Session.isManager('community', community, user) || Session.isSubscribedTo('community', community, user)) {
|
if (Session.isPortalAdministrator(user) || Session.isCommunityCurator(user) || Session.isManager('community', community, user) || Session.isSubscribedTo('community', community, user)) {
|
||||||
console.log("user: has access")
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
this.router.navigate(['/user-info'], {
|
this.router.navigate(['/user-info'], {
|
||||||
|
|
Loading…
Reference in New Issue