Issue#1075: Project global export empty if not requested by first PioneerAdmin#90
Issue#1075: Project global export empty if not requested by first PioneerAdmin#90halfcurry wants to merge 3 commits intosigmah-dev:masterfrom
Conversation
|
Hi, I have assessed the possible causes for why this bug may be occurring. @osarrat please review and mention if I seem to be on the right track. Thanks! Possible Cause #1: In the class org.sigmah.server.security.impl.AccessRights , I could not find any sperm permission entry for the tokens org.sigmah.shared.command.GetOrgUnits, org.sigmah.shared.command.GetContacts, project-exports and EXPORT#EXPORT_GLOBAL (this is based on the warnings generated in the server logs, but I am not sure because they seem to be generated for both the PioneerAdministrator and the created user.) Here are the logs : [WARN ] {09/04/2017 16:23:30.175} [btpool0-6] o.s.s.security.impl.AccessRights - No security permission can be found for token 'org.sigmah.shared.command.GetOrgUnits'. Did you forget to declare corresponding 'sperm'? Possible Cause #2: While creating PioneerAdministrator, we set the values in the table ("INSERT INTO global_permission...") the values 'GLOBAL_EXPORT' by default. Possible cause #3: In the table GlobalExportSettings, The class main.java.org.sigmah.shared.command.GetGlobalExportSettings is constructed with a boolean param retrieveProjectModels. Here is the called line : Why is it always called with the boolean parameter "false" ? |
osarrat
left a comment
There was a problem hiding this comment.
Revise your commit by using the existing log mechanism.
|
|
||
| import javax.persistence.TypedQuery; | ||
|
|
||
| import org.mortbay.log.Log; |
There was a problem hiding this comment.
It would better if you replicate the log mechanism used in other part of the codebase.
There was a problem hiding this comment.
Realised my mistake as soon as I ran it. Thanks!
|
Hi @indianauthority97 , Regarding the cause of this bug, you seem on the right track ! I don't know what is the cause of this bug, but continue to investigate, and you should be able to find the right cause among the three you imagine |
|
Status : Investigated PossibleCause #3 : this is not the reason, it behaves the same way for both users. More research : Identified the place where the difference is happening. org.sigmah.server.dao.impl.ProjectHibernateDAO [Here, the PioneerAdminstrator export call is getting a list of all my projects, but the created user is fetching zero projects i.e. empty list of Collection pmodels in the method getProjects. This could be related to : org.sigmah.server.domain.util.EntityFilters Still working on it. |
|
Hi @osarrat , I updated the issue. Please review it. Thanks! |
|
Hi @indianauthority97 , congrats for this bug fix ! But I won't merge your PR in the end, because while fixing the issue #1081, I have actually made exactly the same modifications that you have done, and thus your code modification is not necessary, but your analysis and work on the fix is useful because you have found the reason of behind this bug. |
0001075: Project global export empty if not requested by first PioneerAdmin
Description: On v2.2, if you are logged in as a recent user (not first PioneerAdmin), when you will make a global export of projects, your export will be empty with only an empty "Project links" tab.
No error message nor trace in the logs.
Steps To Reproduce:
=> the exported file is empty.
Solved this by disabling the user filter which is implicitly applied to the query dataset returned in ProjectHibernateDAO.java [ Read comments below ].
A user created with a custom profile, after doing a global export now gets an excel file correctly populated with the list of projects, as required.