Gaby38 Posted September 18, 2008 Share Posted September 18, 2008 HelloAs I said in a previous post, I was not able to reply to a question about this theme via the forum tool, so I try to post it as a new thread. Perhaps it will work.I am not a Jasperserver "guru" : the way I used is perhaps not the better one but it works. It's for your information if interested :I don't know if it is possible to have a specific home page by user but I did that for a "ROLE". I mean that a logging user goes on a specific existing report (dashboard for example) according to his ROLE.To do that, the general mechanism is to "force" this report as home page instead of the repository view.First, I edited the file "jasperserver-servlet.xml" in WEB-INF directory to add the new home page vs the ROLEs: <property name="homePageByRole"> <list> <value>ROLE_ADMINISTRATOR|redirect:/flow.html?_flowId=repositoryExplorerFlow</value> <value>ROLE_USER|redirect:/flow.html?_flowId=repositoryExplorerFlow</value> <value>ROLE_EVADE|redirect:/flow.html?_flowId=viewEvadeFlow</value> <value>ROLE_KIMOCE|redirect:/flow.html?_flowId=viewKimoceFlow</value> </list> </property>The new "flow files" viewEvadeFlow and viewKimoceFlow are clones of repositoryExplorerFlow in which the report wanted as home page ( EVADEWelcome) is forced :<action-state id="checkForParams"> <set attribute="reportUnit" value="${'/reports/EVADE/EVADEWelcome'}" scope="flow"/> <action bean="viewReportAction"/> <transition on="yes" to="showInputControls"/> <transition on="no" to="verifyData"> <attribute name="requestParsed" value="true" type="java.lang.Boolean"/> </transition> </action-state>But you have also to modify the security rules according to new ROLES and "flow files" in "applicationContext-security.xml" <bean id="filterInvocationInterceptor" class="org.acegisecurity.intercept.web.FilterSecurityInterceptor"> <property name="authenticationManager"><ref bean="authenticationManager"/></property> <property name="accessDecisionManager"><ref local="httpRequestAccessDecisionManager"/></property> <!-- <property name="runAsManager"><ref bean="runAsManager"/></property> --> <property name="objectDefinitionSource"> <value> CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON PATTERN_TYPE_APACHE_ANT /login.html=ROLE_ANONYMOUS,ROLE_USER,ROLE_ADMINISTRATOR,ROLE_EVADE,ROLE_KIMOCE /logout.html=ROLE_ANONYMOUS,ROLE_USER,ROLE_ADMINISTRATOR,ROLE_EVADE,ROLE_KIMOCE,IS_AUTHENTICATED_FULLY /loginerror.html=ROLE_ANONYMOUS,ROLE_USER,ROLE_EVADE,ROLE_KIMOCE,ROLE_ADMINISTRATOR /exituser.html=ROLE_ANONYMOUS,ROLE_USER,ROLE_ADMINISTRATOR,IS_AUTHENTICATED_FULLY /home.html=ROLE_USER,ROLE_ADMINISTRATOR,ROLE_EVADE,ROLE_KIMOCE /flow.html=ROLE_USER,ROLE_ADMINISTRATOR,ROLE_EVADE,ROLE_KIMOCE /loginsuccess.html=ROLE_USER,ROLE_ADMINISTRATOR,ROLE_EVADE,ROLE_KIMOCE /listolapviews.html=ROLE_USER,ROLE_ADMINISTRATOR /fillparams.html=ROLE_USER,ROLE_ADMINISTRATOR,ROLE_EVADE,ROLE_KIMOCE /j_acegi_switch_user*=ROLE_ADMINISTRATOR /fileview/**=ROLE_USER,ROLE_ADMINISTRATOR /olap/**=ROLE_USER,ROLE_ADMINISTRATOR /xmla=ROLE_USER,ROLE_ADMINISTRATOR /services/**=ROLE_USER,ROLE_ADMINISTRATOR /reportimage/**=ROLE_USER,ROLE_ADMINISTRATOR,ROLE_EVADE,ROLE_KIMOCE /jrpxml/**=ROLE_USER,ROLE_ADMINISTRATOR </value> </property> </bean>and further in the same file : <bean id="flowVoter" class="com.jaspersoft.jasperserver.war.security.FlowRoleAccessVoter"> <property name="flowAccessAttribute" value="FLOW_ACCESS"/> <property name="flowDefinitionSource"> <value> repoAdminFlow=ROLE_ADMINISTRATOR userListFlow=ROLE_ADMINISTRATOR roleListFlow=ROLE_ADMINISTRATOR reportUnitFlow=ROLE_ADMINISTRATOR,ROLE_EVADE,ROLE_KIMOCE olapUnitFlow=ROLE_ADMINISTRATOR olapClientConnectionFlow=ROLE_ADMINISTRATOR mondrianXmlaSourceFlow=ROLE_ADMINISTRATOR editFolderFlow=ROLE_ADMINISTRATOR fileResourceFlow=ROLE_ADMINISTRATOR dataTypeFlow=ROLE_ADMINISTRATOR listOfValuesFlow=ROLE_ADMINISTRATOR queryFlow=ROLE_ADMINISTRATOR reportDataSourceFlow=ROLE_ADMINISTRATOR inputControlsFlow=ROLE_ADMINISTRATOR objectPermissionToRoleFlow=ROLE_ADMINISTRATOR userEditFlow=ROLE_ADMINISTRATOR roleEditFlow=ROLE_ADMINISTRATOR queryReferenceFlow=ROLE_ADMINISTRATOR objectPermissionToUserFlow=ROLE_ADMINISTRATOR repositoryExplorerFlow=ROLE_USER,ROLE_ADMINISTRATOR *=ROLE_USER,ROLE_ADMINISTRATOR,ROLE_EVADE,ROLE_KIMOCE </value> </property> </bean>If you do "searches" on this forum you will find other ways to do that .I hope this will help you Link to comment Share on other sites More sharing options...
javi_123 Posted September 23, 2008 Share Posted September 23, 2008 Hi, Is it possible to provide the same type of functionality on a multi-tenanted service, where we have multiple customers using the same application layer (part of which is Jasper) and separate databases. cheers Link to comment Share on other sites More sharing options...
swood Posted October 29, 2008 Share Posted October 29, 2008 This approach for setting the home page looks cumbersome. I think it would have been easier to replace repositoryExplorerFlow with your own flow that had the logic in it to switch home pages. Multi-tenancy is a many tenacled beast, including requirements such as: restricting repository access tenant/customer, user and role management user preferences, including setting a home page clustering, scalabilityJaspersoft has helped many customers implement multi-tenant solutions with services.In the next JasperServer Professional release, we are taking what we have learned and putting multi-tenant features into the core product. ShermanJaspersoft Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now