Skip to content

Unified approval#

Features#

The unified approval consists of three parts:

  • Approval
  • Approval request
  • Approval system

ArkIDCore (approval action,Approval request,Approval system plug -in base class):#

  1. createApproval: Specify the API interface required for approval, And responsible for approving the API callApproval system

  2. Monitor API call: When API calls occur,Do the following treatment:

    • If the API call does not create the correspondingApproval request,API call interrupt,createApproval request,passCREATE_APPROVE_REQUESTThe event is sent to the corresponding approval system。
    • If the API call has created the correspondingApproval request:

      • ShouldApproval requestquiltApproval systemNot processed,API call interrupt
      • ShouldApproval requestquiltApproval systemreject,API call interrupt
      • ShouldApproval requestquiltApproval systemagree,API calls continue to execute
  3. Approval system plug -in base class

    • See ARKID.core.extension.approve_system.ApproveSystemExtension
    • monitorCREATE_APPROVE_REQUESTevent,Define abstract functionscreate_approve_request, The third -party plug -in system can implement this method,Send the approval request to the third -party system for processing
    • Create two interfaces to handle the logic of approval requests passing and rejection:

      • agreeApproval requestinterface

        • path:/approve_requests/{{request_id}}/pass/
        • method: PUT
        • Processing function:pass_approve_request_handler
        • Need to implement abstract methods: pass_approve_request
      • rejectApproval requestinterface

        • path:/approve_requests/{{request_id}}/deny/'
        • method: PUT
        • Processing function:deny_approve_request_handler
        • Need to implement abstract methods: deny_approve_request
  4. ArkIDSystem default approval system

Third -party approval system plug -in can refer to the logic of the system plug -in with the default approval system plug -in, See the default approval system for Extension_root.com_Dragon turtle_approve_system_arkid.ApproveSystemArkIDExtension

评论