Details
-
Suggestion
-
Resolution: Won't Fix
-
None
Description
NOTE: This suggestion is for JIRA Server. Using JIRA Cloud? See the corresponding suggestion.
In the documentation for JIRA you will find a hint how customize the interface depending on the groups a user belongs to.
Actually this does not work for the dashboard-plugin when rendering dashboard.vm as the context does not know about "authcontext". I would like to see this as default context element there, too.
Use Case:
We needed this as workaround for JRA-2364 – Hide Time Tracking estimates from certain users (e.g. customers) as we had to prevent that customers can add gadgets with time tracking information. Our solution was to set maxGadgets to "0" for them and only allow them to use preconfigured dashboards:
#if (!$authcontext.user.inGroup('${showtimetracking.groupname}')) #set($maxGadgets = 0) #end
Where showtimetracking.groupname is set on compilation through resource filtering.
Workaround:
As described in Confluence:
- Add a dependency to the dashboard-plugin-POM:
<dependency> <groupId>com.atlassian.jira</groupId> <artifactId>atlassian-jira</artifactId> <version>4.X.X</version> <scope>provided</scope> </dependency>
- Change DashboardView.java to provide the authcontext:
context.put("authcontext", ComponentManager.getInstance().getJiraAuthenticationContext());
This does the job... but for some reason the UnitTests won't run anymore. I had to disable them with -DskipTests.
Attachments
Issue Links
- relates to
-
JRACLOUD-21257 Add "authcontext" to Velocity-Context when rendering dashboard.vm
- Closed