Skip to content

Business Create UI: refactor roles to permissions #27187

Closed

Description

@severinbeauvais

See details in #27171.

  • removed obsolete isPremiumAccount handling - PR 784
  • removed unneeded Keycloak parsing/roles - PR 785
    .
  • look at code points with conditional for isRoleStaff
  • look at code points with conditional for isSbcStaff
  • remove store getters for role / account type
  • create an enum with entries for code points (generalize if possible)
  • create a utility module with a public function that returns True if current user is allowed to do the action, else False
  • replace getters with "get permissions" function
  • update spreadsheet
  • update unit tests
  • add new filing type roles (amalgamation, firm dissolution, incorporation application, registration, voluntary dissolution)
  • locally test changes

Ref: https://docs.google.com/spreadsheets/d/13P4ZA19lJfXJX95N5OfQMu6jYuotDH6h2hDf2DnAv0E/edit?gid=1335805235#gid=1335805235

Activity

  1. added
    Entities Team
    on Apr 14, 2025
  2. changed the title [-]Business Create UI: add role mixin[/-] [+]Business Create UI: refactor roles to permissions[/+] on Apr 23, 2025
  3. severinbeauvais commented on Apr 24, 2025

    @severinbeauvais
    CollaboratorAuthor

    Outstanding questions

    How are BCOL HD users identified -- do they have a particular Keycloak role(s) or auth role(s)? YES, role "maximus_staff".

    Which "same access as staff"? We can decide this later. This ticket is a refactor only (mostly).

    • staff dashboard? direct business search?
    • affiliate a business without providing credentials?
    • affiliate a NR without providing credentials? probably yes unless they have staff dashboard access
    • should they see staff payment options?
    • should they be able to file staff filings (court order, continue out, amalgamate out, etc)? probably no
    • should they be able to file corrections? probably no
    • should they be able to save filings? or delete draft filings? probably no

    --

    • Should we skip auto-populating Completing Party, same as staff?
    • Should they be able to edit email addresses ("copy of documents to") in a filing?
    • Should they be able to edit Certified By name?
  4. severinbeauvais commented on Apr 29, 2025

    @severinbeauvais
    CollaboratorAuthor

    Test Notes

    This ticket:

    • removed checks for Premium Account handling -- all accounts are now Premium
      • this can be tested by verifying that Premium sections (ie, Folio Number) is displayed regardless of account used (see list below)
      • you actually won't see a difference because old and new code are functionally equivalent
    • removed unneeded Keycloak handling and uses "roles" from Auth API Authorizations call instead
      • this can be tested by verifying that only staff accounts see staff sections
      • you actually won't see a difference because old and new code are functionally equivalent
    • refactored the code from using ifStaff (and isSbcStaff) to ifAuthorized(xxx) (where xxx is a particular permission/action)

    It is expected that the above change nothing functionally -- the updated Create UI pages should work just like the previous ones.

    This ticket is a refactor of existing functionality, so we only need to test regular users, staff users, and SBC Staff users. When we add other account types (eg, Maximum, SBC Contact Centre, SBC Staff Tier 2) then their permissions will need a code change and they can be tested at that time.

    The following code points were changed from "isPremium" to always show (if not staff):

    1. show folio/reference number section (most filings)
    2. dissolution show folio/reference number section
    3. registration show folio/reference number section (disabled)
    4. amalgamation filing restore folio number
    5. continuation in filing restore folio number
    6. incorporation application filing restore folio number
    7. registration filing save folio number
    8. registration filing restore transactional folio number
    9. restoration filing save folio number
    10. restoration filing restore transactional folio number
    11. dissolution filing save folio number
    12. dissolution filing restore transactional folio number
    13. dissolution validate transactional folio number
    14. amalgamation validate folio number
    15. amalgamation show folio/reference number section
    16. continuation in show folio/reference number section
    17. continuation in validate folio/reference number
    18. dissolution show transaction folio number section
    19. firm dissolution show folio/reference number section
    20. incorporation show folio/reference number section
    21. registration show transactional folio number section
  5. severinbeauvais commented on May 7, 2025

    @severinbeauvais
    CollaboratorAuthor

    Sample Fetch Error dialog (is same for staff and regular user):

    image.png

    Sample Payment Error dialog with an error and warning (as staff):

    image.png

    Sample Payment Error dialog with no errors or warnings (as staff):

    image.png

    Sample Payment Error dialog with an error and warning (as regular user):

    image.png

    Sample Payment Error dialog with no errors or warnings (as regular user):

    image.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Entities Team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions