Skip to content

feat(#10341): remove chtPermissionsSettings param#2209

Merged
jkuester merged 2 commits into
mainfrom
10341-no-settings-for-hasPermissions
May 11, 2026
Merged

feat(#10341): remove chtPermissionsSettings param#2209
jkuester merged 2 commits into
mainfrom
10341-no-settings-for-hasPermissions

Conversation

@jkuester
Copy link
Copy Markdown
Contributor

@jkuester jkuester commented May 1, 2026

Description

As a part of resolving medic/cht-core#10341, medic/cht-core#10795 has removed the need for every passing the chtPermissionsSettings parameter when calling hasPermissions or hasAnyPermissions on the cht-datasource api (from tasks/targets/contact-summary/purging config code). Previously this parameter was optional for tasks/targets/contact-summary since the webapp would automatically supply it if it was missing. However, it was required for purging config. Now it is not required at all and there is no situation where the chtPermissionsSettings parameter should ever be provided. (Though we still accept it for backwards compatibility.)

I am removing documentation for this parameter since it should no longer be relevant (even for purging config).

License

The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.

@jkuester jkuester requested a review from sugat009 May 1, 2026 16:59
Copy link
Copy Markdown
Member

@sugat009 sugat009 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. One question I wanted to ask, no problem either way.

Since chtPermissionsSettings is technically still accepted (you've framed it as deprecated in the index.ts docs) and cht-docs isn't version pinned, would a small marker on these two rows help users on CHT < 5.2.0? Something like:

_Updated in v5.2.0: chtPermissionsSettings is no longer required._

in line with the existing _Introduced in v4.11.0_ pattern on analytics.getTargetDocs(). Curious what you think.

Also a tiny nit: stray <br> left at the end of the userRoles description on the hasAnyPermission row.

@jkuester
Copy link
Copy Markdown
Contributor Author

Thanks @sugat009! I ended up going for a bit extra completion here. The chtPermissionsSettings has been optional for the webapp config (contact-summary, tasks-targets) since it got added to the webapp so I don't think we need to worry about documenting the parameter for that API. However, the purge config actually has access to a slightly different CHT API (without the webapp extensions). To try and mitigate some of the config confusion here, I have updated the purge documentation to have its own API reference docs that are more accurate. In those docs, I noted how the permissions settings parameter was optional after 5.2.0. 👍

@jkuester jkuester merged commit 58aefd0 into main May 11, 2026
2 checks passed
@jkuester jkuester deleted the 10341-no-settings-for-hasPermissions branch May 11, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants