Home Forums Development Hiding/Showing a workspace in the navigation bar based on a permission

Tagged: ,

Viewing 7 reply threads
  • Author
    Posts
    • #23704
      Max WidmaierMax Widmaier
      Participant

      We are trying to add a workspace that would be visible only if a user has a certain permission. This works for the imports:ImportProcess and mda:Campaign workspaces; however, I cannot find any option/parameter to make a workspace visible based on permissions. Is this some sort of framework option? Does it have to do with some sort of database column or something?

      Thank you!

      0
    • #23713
      Max WidmaierMax Widmaier
      Participant

      I just found a column in the workspaces table called viewprivilege. Is there any way to specify this? Or does there need to be some sort of database upgrade?

      0
    • #23721
      Stephane Lachancestephane.lachance
      Participant

      Hi Max,

      The visibility of a workspace is driven off a specific privilege granted to the logged-in user. The general rule is as follows:

      • The logged-in user must be granted the privilege of the PortletRef marked as required contained within the workspace.

      In more specific cases:

      • A PortletRef can be marked as required and a privilege can be explicitly assigned to that portlet.
      • A Navigator portlet is implicitly considered to be marked as required and, similarly, a privilege can be explicitly assigned.
        • In this special case, sometimes the privilege to grant is implied through the read event needed to load the data table. This is in place for the Campaign workspace.
          • Ie. The navigator data table reads the Campaign metaclass while its ‘read event explicitly requires the CampaignView privilege.

      0
    • #23729
      Max WidmaierMax Widmaier
      Participant

      Thank you very much!

      0
    • #23737
      Max WidmaierMax Widmaier
      Participant

      It doesn’t seem to work…
      The workspace doesn’t have a navigation portlet, so I added a required “PermissionPortlet”. The portlet doesn’t render without the permission but the workspace in the sidebar still appears.

      So I have:
      <Portlet privilege=”PermissionName”>
      <Composite name=”nothing”/>
      </Portlet>

      With the workspace being:
      <Workspace caption=”ids.caption” icon=”icon”>
      <Page name=”pageContent”>
      <Tab caption=”ids.some.other.caption” name=”tab”>
      <PortletRef name=”refReactApp” portlet=”react/portlet”/>
      <PortletRef name=”permissionPortlet” portlet=”bgm:PermissionPortlet” required=”true”/>
      </Tab>
      </Page>
      </Workspace>

      0
    • #23745
      Stephane Lachancestephane.lachance
      Participant

      Hi Max,

      There’s a working example of this pattern included in the core CRM product already. Take a look at how the mda:engage:Nudge workspace is implemented with the mda:engage:NudgeFooter portlet.

      0
    • #23753
      Max WidmaierMax Widmaier
      Participant

      Ok thank you! That seems to have worked!

      0
    • #23761
      Stephane Lachancestephane.lachance
      Participant

      Any idea what you had to modify/add in your implementation? At a quick glance, I don’t see many differences from the snippets you provided earlier.

      0
Viewing 7 reply threads
  • You must be logged in to reply to this topic.