You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import type { MashroomPortalAppPluginBootstrapFunction } from "@mashroom/mashroom-portal/type-definitions";
// This allows lazy load of actual bootstrap.
// It is required to support microfrontend using Mashroom and Webpack Module Federation
const bootstrap: MashroomPortalAppPluginBootstrapFunction = async (
portalAppHostElement,
portalAppSetup,
clientServices,
) => {
try {
const bootstrapModule = await import("./bootstrap");
const mashroomBootstrap = bootstrapModule.bootstrap;
mashroomBootstrap(portalAppHostElement, portalAppSetup, clientServices);
} catch (error) {
console.error("Error importing the module:", error);
}
};
(global as any).reactUserMgtBootstrap = bootstrap;
I am developing a ReactJS plugin application (let's call it "plugin-app2") that will be integrated with the Mashroom portal web application. In this plugin application, I need to check the user's role to conditionally show or hide certain functionalities based on their permissions.
Is there a way to retrieve the roles assigned to the currently logged-in user within the Mashroom portal? This information would allow me to control the visibility of features in my ReactJS plugin application based on the user's role and permissions.
If there is a method or API provided by the Mashroom portal to access the user's role information, could someone please guide me on how to implement it in my ReactJS application?
Any help or suggestions would be greatly appreciated.
The text was updated successfully, but these errors were encountered:
atans96
changed the title
Get the roles from mashroom for OIDC plugin
How to retrieve the user's roles in a ReactJS plugin application integrated with the Mashroom portal?
Jun 6, 2024
One of the design goals of Mashroom was to make the Apps portable and maximally reusable, therefore it is not possible to directly check some roles (which may be different from server to server). Instead, you can define permissions which are mapped to roles in the metadata. The App itself only receives a map of "permission name" -> boolean.
I am developing a ReactJS plugin application (let's call it "plugin-app2") that will be integrated with the Mashroom portal web application. In this plugin application, I need to check the user's role to conditionally show or hide certain functionalities based on their permissions.
Is there a way to retrieve the roles assigned to the currently logged-in user within the Mashroom portal? This information would allow me to control the visibility of features in my ReactJS plugin application based on the user's role and permissions.
If there is a method or API provided by the Mashroom portal to access the user's role information, could someone please guide me on how to implement it in my ReactJS application?
Maybe this?
Any help or suggestions would be greatly appreciated.
The text was updated successfully, but these errors were encountered: