Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure FA permissions to send incomplete declarations #4596

Closed
4 tasks
anny320 opened this issue Jan 19, 2023 · 3 comments
Closed
4 tasks

Configure FA permissions to send incomplete declarations #4596

anny320 opened this issue Jan 19, 2023 · 3 comments

Comments

@anny320
Copy link

anny320 commented Jan 19, 2023

Problem statement

Add configuration setting to prevent field agents from submitting partially completed forms
(Describe the problem you're trying to solve by doing this work)

Tech design fundamentals

  • User scopes need to be as granular as possible. User scope is the smallest unit of the system,
  • User scopes need to be documented comprehensively so that all behaviours are known
  • For wider permission sets (for instance functionality based) we define "permission sets"

Tech design

The full scopes definition can be found here.

For us to be able to introduce more scopes that are more granular than the earlier ones, we should always consider the existing, old scope as a "permission set". So as an example, we could consider the current day "declare" scope to be an alias for all of the following:

  • Create Birth Declarations Any Jurisdiction
  • Create Birth Declarations Only My Jurisdiction
  • Create Death Declarations Any Jurisdiction
  • Create Death Declarations Only My Jurisdiction
  • Create Marriage Declarations Only My Jurisdiction
  • Create Marriage Declarations Any Jurisdiction
  • Update Declarations
  • Submit Incomplete Declarations
  • Submit Declarations For Approval
const PERMISSION_SETS = {
  "declare": [
    "create-birth-declarations-any-jurisdiction",
    "create-birth-declarations-only-my-jurisdiction",
    "create-death-declarations-any-jurisdiction",
    "create-death-declarations-only-my-jurisdiction",
    "create-marriage-declarations-only-my-jurisdiction",
    "create-marriage-declarations-any-jurisdiction",
    "update-declarations",
    "submit-incomplete-declarations",
    "submit-declarations-for-approval",    
  ]
}

We support this permission set at least for a few versions until our new scope definitions have stabilised a little.

const disableDeclareButtonWhenIncomplete = hasScope(user, 'submit-incomplete-declarations')
  • Ensure Custom, scope-based user roles #7053 has been merged to develop
  • In commons, implement a hasScope(userScopesOrPermissionSets: string[], scope: Scope): boolean function that knows how to expand permission sets. Hardcode the first permission set to this file: declare. Notice that you might need to create other sets as part of this task, like create-birth-declaration.
  • Research where the declare scope is being checked and replace those code points with more granular scope requirements.
  • Implement a new user scope submit-incomplete-declaration. Make this scope control if a declaration can be sent incomplete or not
@jpye-finch jpye-finch changed the title Configuration: FA should not submit incomplete Notifications Configure FA permissions to send incomplete declarations Jan 19, 2023
@jpye-finch jpye-finch moved this to Backlog in OpenCRVS Core Nov 22, 2023
@euanmillar euanmillar added this to the v1.6.0 milestone Jan 22, 2024
@euanmillar euanmillar modified the milestones: v1.6.0, 1.7.0 Apr 29, 2024
@rikukissa
Copy link
Member

Depends on #7053

@euanmillar
Copy link
Collaborator

@jpye-finch if this is covered in Custom Users & Scopes, can you check? If so, please close the issue and remove it from the project. I removed it from 1.7 backlog

@jpye-finch
Copy link
Collaborator

closing:

scope: record.declaration-submit-incomplete - added as part of #6455

@github-project-automation github-project-automation bot moved this from In Design to Completed in OpenCRVS Core Nov 21, 2024
@jpye-finch jpye-finch removed the status in OpenCRVS Core Nov 21, 2024
@euanmillar euanmillar added this to the w Discuss Horizon or IET milestone Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants