Event capture and reports do not observe DE sharing settings

Hi Devs
I noticed in a test in v 2.25 build 227ca38 that event capture will show and allow data entry for data elements that are not shared with the user, in event reports the data element shows up in the list of items to select but the data is not presented to the user.

This seems to be a bug, an object that is not shared should not be visible to the user.

Here are the steps to replicate in play.dhis2.org/demo:

  1. Create a test user and assign the data entry clerk user role and the root org unit

  2. Create two tracker data elements, one public and the other private.

  3. Create an event program and assign it to the root org unit

  4. Edit the program stage and add the two data elements created in step 2

  5. Edit the data entry clerk user role and add the program created in step 3 plus the following authorities: see event capture module; add/update tracked entity data value; delete tracked entity data value

  6. Login with the test account and open event capture, select the root org unit if it is not already selected, select the test program created in step 3

  7. Register a new event, select the date and verify if both test data elements created in step 3 are present in the form. Only the public data element should be present in the form, add values the data elements and save the event then verify if both data elements are shown in the list of events.

The same happens with tracker capture.

Regards,

JM