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

Store terms and condition acceptance record in database #1382

Open
5 tasks
MCatherine1994 opened this issue May 13, 2024 · 2 comments
Open
5 tasks

Store terms and condition acceptance record in database #1382

MCatherine1994 opened this issue May 13, 2024 · 2 comments
Labels
Act as Delegated Admin Category label from https://apps.nrs.gov.bc.ca/int/confluence/x/VoC9CQ Terms of Use Category label from https://apps.nrs.gov.bc.ca/int/confluence/x/VoC9CQ

Comments

@MCatherine1994
Copy link
Collaborator

MCatherine1994 commented May 13, 2024

Describe the task
Create a new data table to store the acceptance record of terms and conditions for fam delegated admin bceid users.

Acceptance Criteria

  • Create a new table, include columns user_id, terms and conditions version, accept date
  • Create an api to check if user needs to accept the terms and conditions, add basic security check that user is app admin or delegated admin
  • Create an api to store when user accept the terms and conditions, add basic security check that user is app admin or delegated admin
  • add database user permissions to insert, read from new table (insert only, no edits)
  • Regenerate client-code-gen

Additional context

@MCatherine1994 MCatherine1994 added the Act as Delegated Admin Category label from https://apps.nrs.gov.bc.ca/int/confluence/x/VoC9CQ label May 13, 2024
@MCatherine1994
Copy link
Collaborator Author

Another idea Ian suggested that we can create an validation method to check if user needs to accept the terms and conditions, add the check to the get my access api, and return false in the json. But we need to think about the get my access api is under admin management apis, but we want to reuse that in regular apis.

@MCatherine1994
Copy link
Collaborator Author

MCatherine1994 commented May 13, 2024

I was thinking about to do user's terms and condition check with the get_admin_user_access api.

If we add a validation method to check that when calling get_admin_user_access , currently this method will be called every time after user login to FAM. However, no matter we call the validation as router guard, or in the api cal:

  • If user already accepts terms and conditions, return user's access directly
  • If user needs to accept, we have to return something different than the current return to indicate that we need to popup the terms and conditions for the user. And once the user accept the terms and conditions, we have to call the get_admin_user_access api again to get user's access.
    By that said, I feel this doesn't simplify the apis, also will cause duplicate.
    Image

If we create a new api to check if user needs to accept terms and conditions, this is nothing related to the admin management apis. So every time when user login:

  • check if user needs to accept terms and conditions
    • if hasn't accept show popup, when accept, call get my admin access api
    • if accepted already, call get my admin access api
      But need to think about what should we return in the case user needs to accept terms and conditions, throw any error and catches in frontend? or return 200 with data "FALSE"?

@gormless87 gormless87 added the Terms of Use Category label from https://apps.nrs.gov.bc.ca/int/confluence/x/VoC9CQ label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Act as Delegated Admin Category label from https://apps.nrs.gov.bc.ca/int/confluence/x/VoC9CQ Terms of Use Category label from https://apps.nrs.gov.bc.ca/int/confluence/x/VoC9CQ
Projects
None yet
Development

No branches or pull requests

2 participants