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://apps.dhis2.org/app/2c3510dd-d471-4c9d-9f3d-fd4a8601fab9
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;