ERROR!- User does not have write access to category option combo

Dear All,
When enter data from user end showing error on one age group (0-5 years)
User does not have write access to category option combo: X0ylwqzbF1Q, errors: [User has no data write access for CategoryOption: Qf7Vput58Qf]
All other age group working fine.

Please need some help.

1 Like

Hi @Mahbubul_Alam, our team from @dhis2-apps will get back to you shortly on this.

Best,
James.

Thanks for your reply… We are using DHIS2 2.29 …waiting for your team response…

1 Like

@Mahbubul_Alam, this most likely relates to the new sharing model introduced in 2.29.

if you have access to the back end, run
" UPDATE dataelementcategoryoption SET publicaccess = ‘rwrw----’; "
in postgresql

regards
Calle

2 Likes

Thanks @Calle_Hedberg Problem solved…

Regard
Mahbub

2 Likes

Hi @Mahbubul_Alam,

So exactly what was the problem, if it wasn’t the dataelementcategoryoption table’s publicaccess setting? Just interesting to know…

Regards

Calle

1 Like

Hi @Calle_Hedberg , after run this update query, i have to clean the browser cache and it’s worked,…
But form today… the same problem happening again…this time not only 0-5 years, this happening with all fields of all forms.
Please need some urgent help

1 Like

Hi @Mahbubul_Alam,

Kindly Confirm if the Category option, Category and the category combination are shared with the right group.

Best,
James.

Hi @jomutsani
I checked, Category option, Category and the category combination are shared with the right group.
All those sharing settings are properly done… but problem not solved yet…

2 Likes

3 posts were split to a new topic: User does not have write access to category option combo

Hi All,
I have the same problem but I have only access as Admin (or superuser).

What should I do please?

Thanks

1 Like

@mangamanga,

Have you run
" UPDATE dataelementcategoryoption SET publicaccess = ‘rwrw----’; "
in postgresql?

regards
calle

1 Like

I don’t know how to run it from where ?

I don’t have access to server. I only have access on Admin

Thank you

1 Like

@mangamanga

In order to run that script, you need access to the database (so you run the script from the postgresql command line interface, or from e.g. a PGadmin script window).

Since you do not have access to the database, you will have to do the same manually - easy if your database has few Category Options, but a pain if there are many:

  1. Go to Maintenance
  2. Select Category option (listing)
  3. For each Category option, click the menu (three vertical dots) and then Sharing Settings.
  4. Click the setting for public access (left of the two icons)
  5. Select METADATA -> Can Edit and view
  6. Select DATA -> Can capture and view
  7. Close, then continue doing the same with all other Category options.

Doing all of them one-by-one in the UI has the same effect as running the above script in the database itself.

After completing, then

  • Go to Data Administration, select Maintenance, then tick Clear application cache and then “perform maintenance”
  • Run the Browser Cache Cleaner

Then check if your problem has been solved.

Regards
Calle

1 Like

For the one interested (or that don’t have access to the db)

I wrote dhis2 taskr recipes to change these permissions via the api.
Dhis2 taskr is custom dhis2 app that allows you run script against the api
https://play.dhis2.org/appstore/app/mU8EllzZIQn

const api = await dhis2.api();

const co = await api.get("categoryOptions", { fields: ":all", paging: false });

const results = [];
for (cat of co.categoryOptions) {
  cat.publicAccess = "rwrw----";
  data = {
    meta: { allowPublicAccess: true, allowExternalAccess: false },
    object: cat
  };
  try {
    const share = await api.post(
      "sharing?type=categoryOption&id=" + cat.id,
      data
    );
    results.push(share);
  } catch (e) {}
}

return results;