Skip to content

Legal API: add permission checks (instead of KC role checks) to filings - Step 1 #27211

Closed

Description

@severinbeauvais

Currently, the API uses "allowable actions" to allow/deny actions (like filings) depending on business type, business state, filing type, and whether the user is staff or not (according to KC roles).

However, other types of accounts were recently implemented. The allowable actions should now look at permissions (which are already set according to account type) to determine whether to allow/deny certain filings for the current user.

Basically, this is a combination of allowable actions + authorized actions (aka permissions).

Note: Its (priority 1) in the EPIC

Activity

  1. added
    Entities Team
    on Apr 15, 2025
  2. changed the title [-]Legal API: add role check[/-] [+]Legal API: add role checks[/+] on Apr 15, 2025
  3. changed the title [-]Legal API: add role checks[/-] [+]Legal API: add role checks (FUTURE?)[/+] on May 6, 2025
  4. changed the title [-]Legal API: add role checks (FUTURE?)[/-] [+]Legal API: add role checks (future?)[/+] on May 6, 2025
  5. severinbeauvais commented on May 9, 2025

    @severinbeauvais
    CollaboratorAuthor

    I think we can do this after initial MVP.

    This is to protect the Legal API (and everything behind it) from unauthorized filings. For MVP, the UIs will prevent these, but it may be possible (eg, external API users) to circumvent this. We definitely need to do this but I think it's low risk for now.

    @OlgaPotiagalova

  6. changed the title [-]Legal API: add role checks (future?)[/-] [+]Legal API: add role checks (future)[/+] on May 21, 2025
  7. severinbeauvais commented on May 27, 2025

    @severinbeauvais
    CollaboratorAuthor

    A large discussion about Authorized Actions vs Allowable Actions, and STAFF vs SYSTEM roles, had taken place in ticket #28599 -- see comments starting on May 26.

    I believe THIS is the ticket to continue that conversation.

    cc: @argush3 @thorwolpert @chenhongjing @seeker25

  8. changed the title [-]Legal API: add role checks (future)[/-] [+]Legal API: add role checks (P1)[/+] on Jul 29, 2025
  9. 1 remaining item

  10. changed the title [-]Legal API: add role checks (priority 1)[/-] [+]Legal API: add permission checks (instead of KC role checks) to filings (priority 1)[/+] on Jul 29, 2025
  11. severinbeauvais commented on Jul 29, 2025

    @severinbeauvais
    CollaboratorAuthor

    @vysakh-menon-aot I've updated this ticket's description. I think this ticket should be worked on before the others. What do you think about the proposed changes and priority?

  12. self-assigned this
    on Jul 30, 2025
  13. Rajandeep98 commented on Jul 31, 2025

    @Rajandeep98
    Collaborator

    implementing locally for now

  14. Rajandeep98 commented on Aug 6, 2025

    @Rajandeep98
    Collaborator
    • Make sure things work as a user invoking the api with api user keys
  15. Rajandeep98 commented on Aug 11, 2025

    @Rajandeep98
    Collaborator

    QA Notes:
    Allowed Users shouldnt see this message:

    "message": "Permission Denied - You do not have permissions to submit this type of filing for: XXXXXXX."

    • Test From UI for all filings to compare between diff roles
    • Test From API (Postman) Requests for each filings
    • Dissolution Filing Type / Filings which have subtypes test them with api side
    • Should not be able to post request to permissions endpoint, only get request should be allowed.
  16. changed the title [-]Legal API: add permission checks (instead of KC role checks) to filings (priority 1)[/-] [+]Legal API: add permission checks (instead of KC role checks) to filings [/+] on Aug 12, 2025
  17. Rajandeep98 commented on Aug 19, 2025

    @Rajandeep98
    Collaborator

    "STAFF_FILINGS"
    "TRANSITION_FILING”<> transition
    "VOLUNTARY_DISSOLUTION_FILING" <> DISSOLUTION_VOLUNTARY
    "ADMIN_DISSOLUTION_FILING" <> DISSOLUTION_ADMINISTRATIVE
    "AGM_CHG_LOCATION_FILING" <> agmLocationChange
    "AGM_EXTENSION_FILING" <> agmExtension
    "ALTERATION_FILING" <> alteration
    "AMALGAMATION_FILING" <> amalgamationApplication
    "ANNUAL_REPORT_FILING" <> annualReport
    "CONSENT_AMALGAMATION_OUT_FILING" <> amalgamationOut
    "CONSENT_CONTINUATION_OUT_FILING" <> continuationOut
    "CONTINUATION_IN_FILING" <> continuationIn
    "CORRECTION_FILING" <> correction
    "COURT_ORDER_FILING” <> courtOrder
    "DELAY_DISSOLUTION_FILING" <> dissolution
    "DIRECTOR_CHANGE_FILING" <> changeOfDirectors
    "FIRM_CHANGE_FILING" <> changeOfRegistration
    "FIRM_CONVERSION_FILING”<> conversion
    "FIRM_DISSOLUTION_FILING”<> dissolution
    "INCORPORATION_APPLICATION_FILING”<> incorporationApplication
    "NOTICE_WITHDRAWAL_FILING”<>noticeOfWithdrawal
    "RESTORATION_REINSTATEMENT_FILING" <> restoration
    "REGISTRATION_FILING”<> registration
    "SPECIAL_RESOLUTION_FILING" <> specialResolution
    "ADDRESS_CHANGE_FILING" <> changeOfAddress

  18. riyazuddinsyed commented on Aug 20, 2025

    @riyazuddinsyed
    Contributor

    Verified in test.Working as expected.

  19. changed the title [-]Legal API: add permission checks (instead of KC role checks) to filings [/-] [+]Legal API: add permission checks (instead of KC role checks) to filings - Step 1[/+] on Aug 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Entities Team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions