X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=skyquake%2Fframework%2Fwidgets%2Fskyquake_rbac%2FskyquakeRBAC.jsx;h=cbb6a567ff2ac48293245ac6f8abc98efb9a0793;hb=96b7649b2db9ab306a20b43db5f77b6111d746ed;hp=e00e67254f136de54f077e3a45a30b59dbd5e57d;hpb=2ff1ddba3d20163b110f27abfe7875d6edf2255c;p=osm%2FUI.git diff --git a/skyquake/framework/widgets/skyquake_rbac/skyquakeRBAC.jsx b/skyquake/framework/widgets/skyquake_rbac/skyquakeRBAC.jsx index e00e67254..cbb6a567f 100644 --- a/skyquake/framework/widgets/skyquake_rbac/skyquakeRBAC.jsx +++ b/skyquake/framework/widgets/skyquake_rbac/skyquakeRBAC.jsx @@ -26,15 +26,16 @@ export default class SkyquakeRBAC extends React.Component { super(props); } render() { - const User = this.context.userProfile.data; + const User = this.context.userProfile; + const UserData = User.data; let HTML = null; // If user object has platform property then it has been populated by the back end. - if(User) { - const PlatformRole = User.platform.role; + if(UserData) { + const PlatformRole = UserData.platform.role; const isPlatformSuper = PlatformRole[PLATFORM.SUPER]; const isPlatformAdmin = PlatformRole[PLATFORM.ADMIN]; const isPlatformOper = PlatformRole[PLATFORM.OPER]; - const hasRoleAccess = checkForRoleAccess(User.project[this.props.project], PlatformRole, this.props.allow)//false//(this.props.roles.indexOf(userProfile.projectRole) > -1) + const hasRoleAccess = checkForRoleAccess(UserData.project[User.projectId], PlatformRole, this.props.allow)//false//(this.props.roles.indexOf(userProfile.projectRole) > -1) if (isPlatformSuper) { HTML = this.props.children; } else {