This commit is contained in:
Massimiliano Assante 2024-04-22 17:11:42 +02:00
parent 7cf9dd8700
commit d6ba384097
3 changed files with 9 additions and 1 deletions

View File

@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v2.1.0-SNAPSHOT] - 2024-04-22
- Fix for Incident #27306
## [v2.0.1] - 2022-06-16

View File

@ -12,7 +12,7 @@
<artifactId>accept-invite-portlet</artifactId>
<packaging>war</packaging>
<name>accept-invite-portlet Portlet</name>
<version>2.1.0.SNAPSHOT</version>
<version>2.1.0-SNAPSHOT</version>
<description>
accept-invite-portlet manage the sent invitations
</description>

View File

@ -31,6 +31,7 @@ import org.apache.commons.codec.binary.Base64;
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
import org.gcube.common.authorization.library.provider.UserInfo;
import org.gcube.common.portal.PortalContext;
import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.portal.databook.server.DBCassandraAstyanaxImpl;
import org.gcube.portal.databook.server.DatabookStore;
import org.gcube.portal.databook.shared.Invite;
@ -88,6 +89,9 @@ public class PortletViewController {
*/
public static synchronized DatabookStore getStore() {
if (store == null) {
PortalContext pContext = PortalContext.getConfiguration();
String context = "/" + pContext.getInfrastructureName();
ScopeProvider.instance.set(context);
store = new DBCassandraAstyanaxImpl();
}
return store;
@ -123,6 +127,8 @@ public class PortletViewController {
try {
String token = generateAuthorizationToken();
SecurityTokenProvider.instance.set(token);
invite = getStore().readInvite(inviteId);
} catch (InviteIDNotFoundException | InviteStatusNotFoundException e) {
e.printStackTrace();
@ -157,6 +163,7 @@ public class PortletViewController {
private static String generateAuthorizationToken() {
PortalContext pContext = PortalContext.getConfiguration();
String context = "/" + pContext.getInfrastructureName();
ScopeProvider.instance.set(context);
String username = "roberto.cirillo";
List<String> userRoles = new ArrayList<>();
userRoles.add(DEFAULT_ROLE);