Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

As observed in the following workflow: if the employee passes through the permissions check, the subsequent step will involve an action with currencies.updateCurrency. Afterward, the success and error flows will lead to the end node.

The audit logs for such workflow will be the following:


The runtimes for such workflow will be the following:As an admin with permissions to edit employee and role configurations, add the viewCurrencies and editCurrency permissions for the employee role. This will simplify configurations for updating currency configurations related to Currency.

...


Login to Puppeteer with the credentials businessanalyst@marionette.dev and navigate to the Configurations page. Once there, locate the "Currencies" sub-menu.

...


For example, an employee with these permissions can update currency position, precision, and name

The audit logs for such workflow will be the following:

...

Expand
titleFull Audit logs code for Workflow
Code Block
{
  "initialData": {
    "name": "ETHEREUM",
    "id": "ETH",
    "precision": 8,
    "position": 2,
    "lightBgColor1": "#4c6fc2",
    "lightBgColor2": "#7ca5eb",
    "lightTextColor": "#ffffff",
    "darkBgColor1": "#4c6fc2",
    "darkBgColor2": "#19409c",
    "darkTextColor": "#ffffff",
    "userBalanceEnable": true,
    "enabled": true,
    "hide": false,
    "trading_commission_enabled": true,
    "payout_fee": 1,
    "min_payout_fee": 0.001,
    "max_payout_fee": 1
  },
  "initialMeta": {
    "userIP": "176.120.105.193",
    "userAgent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:124.0) Gecko/20100101 Firefox/124.0",
    "method": "POST",
    "path": "api/v2/",
    "decodedUser": {
      "exp": 1715503657,
      "sub": "session",
      "iss": "marionette",
      "aud": [
        "marionette"
      ],
      "jti": "b0ebeba5-79b1-4e28-b22e-ba0ed1c3635d",
      "uid": "872a9c32db4545e8ac731551fb61c227",
      "email": "businessanalyst@marionette.dev",
      "role": "admin",
      "level": 3,
      "state": "active",
      "referral_id": null
    },
    "user": {
      "id": "872a9c32db4545e8ac731551fb61c227",
      "email": "businessanalyst@marionette.dev",
      "password": "sha256$4be643c4$1$95c93926a1850e210d379a4922c03cc7f397828e090c0cd9fac794af4447d065",
      "username": null,
      "role": "ADMIN",
      "state": "active",
      "referralId": null,
      "referralGroupId": null,
      "locale": null,
      "email_verified": false,
      "phone_verified": false,
      "profile_verified": false,
      "isPhone": null,
      "data": null,
      "otp": false,
      "enabled2fa": false,
      "secret2fa": "",
      "googleIdentity": false,
      "softban": false,
      "createdAt": "2024-02-13T18:50:17.000Z",
      "updatedAt": "2024-04-12T08:44:05.000Z"
    },
    "permissions": [
      "editCurrency",
      "viewCurrencies"
    ],
    "token": "eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3MTU1MDM2NTcsInN1YiI6InNlc3Npb24iLCJpc3MiOiJtYXJpb25ldHRlIiwiYXVkIjpbIm1hcmlvbmV0dGUiXSwianRpIjoiYjBlYmViYTUtNzliMS00ZTI4LWIyMmUtYmEwZWQxYzM2MzVkIiwidWlkIjoiODcyYTljMzJkYjQ1NDVlOGFjNzMxNTUxZmI2MWMyMjciLCJlbWFpbCI6ImJ1c2luZXNzYW5hbHlzdEBtYXJpb25ldHRlLmRldiIsInJvbGUiOiJhZG1pbiIsImxldmVsIjozLCJzdGF0ZSI6ImFjdGl2ZSIsInJlZmVycmFsX2lkIjpudWxsfQ.2meEWB_-1J1veu86q201--x5NduugDMRHWX_vwActqsyz_62RhkXICU41J9g8A6TzxoaYPncxdEypvnzIFunz6Xvx70JM-03cCPsJ74Lz6LGNt2KApkNkuJ_vdMVzqtpVp-RxNnylnqgwtHISjShEtBs8cCVvXWTfGJYh_FvC6AWccZt8hI6sHNzP3yVhz13BPJlejOYF4OYyh3iNPXlj3PkT9lfm7szyuWrBCD4gLKtABhzj2W8VWJOuhTmv8M4yw5teCH5rxobL9838r8qEcOsm6SM6fSmyVtpbxcdI8K0b1UJWcxhY5D0SYKWCLSd4n4GBA9ubvJVHIGFZcurqg",
    "isApiKey": false
  }
}
Expand
titleFull Audit logs for Action call

Code Block
{
  "params": {
    "name": "ETHEREUM",
    "id": "ETH",
    "precision": 8,
    "position": 2,
    "lightBgColor1": "#4c6fc2",
    "lightBgColor2": "#7ca5eb",
    "lightTextColor": "#ffffff",
    "darkBgColor1": "#4c6fc2",
    "darkBgColor2": "#19409c",
    "darkTextColor": "#ffffff",
    "userBalanceEnable": true,
    "enabled": true,
    "hide": false,
    "trading_commission_enabled": true,
    "payout_fee": 1,
    "min_payout_fee": 0.001,
    "max_payout_fee": 1
  },
  "result": {
    "id": "ETH",
    "name": "ETHEREUM",
    "userBalanceEnable": true,
    "lightBgColor1": "#4c6fc2",
    "lightBgColor2": "#7ca5eb",
    "darkBgColor1": "#4c6fc2",
    "darkBgColor2": "#19409c",
    "lightTextColor": "#ffffff",
    "darkTextColor": "#ffffff",
    "icon_url": "https://devtunexio.sfo2.digitaloceanspaces.com/e3f46f79-a95f-40d5-bb19-3560b86de532.svg",
    "precision": 8,
    "enabled": true,
    "position": 2,
    "trading_commission_enabled": true,
    "hide": false,
    "staking_enabled": false,
    "staking_period": "*/10 * * * *",
    "staking_apr": 150,
    "last_staking_calc": 1703838600000,
    "min_staking_amount": 0.01,
    "instant_unstaking": true,
    "payout_fee": 1,
    "min_payout_fee": 0.001,
    "max_payout_fee": 1,
    "createdAt": "2023-05-10T06:21:09.000Z",
    "updatedAt": "2024-04-12T08:55:35.436Z"
  }
}

The runtimes for such workflow will be the following:

...

Expand
titleRuntime details
Code Block
{
  "initialData": {
    "name": "ETHEREUM",
    "id": "ETH",
    "precision": 8,
    "position": 2,
    "lightBgColor1": "#4c6fc2",
    "lightBgColor2": "#7ca5eb",
    "lightTextColor": "#ffffff",
    "darkBgColor1": "#4c6fc2",
    "darkBgColor2": "#19409c",
    "darkTextColor": "#ffffff",
    "userBalanceEnable": true,
    "enabled": true,
    "hide": false,
    "trading_commission_enabled": true,
    "payout_fee": 1,
    "min_payout_fee": 0.001,
    "max_payout_fee": 1
  },
  "initialMeta": {
    "userIP": "176.120.105.193",
    "userAgent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:124.0) Gecko/20100101 Firefox/124.0",
    "method": "POST",
    "path": "api/v2/",
    "decodedUser": {
      "exp": 1715503657,
      "sub": "session",
      "iss": "marionette",
      "aud": [
        "marionette"
      ],
      "jti": "b0ebeba5-79b1-4e28-b22e-ba0ed1c3635d",
      "uid": "872a9c32db4545e8ac731551fb61c227",
      "email": "businessanalyst@marionette.dev",
      "role": "admin",
      "level": 3,
      "state": "active",
      "referral_id": null
    },
    "user": {
      "id": "872a9c32db4545e8ac731551fb61c227",
      "email": "businessanalyst@marionette.dev",
      "password": "sha256$4be643c4$1$95c93926a1850e210d379a4922c03cc7f397828e090c0cd9fac794af4447d065",
      "username": null,
      "role": "ADMIN",
      "state": "active",
      "referralId": null,
      "referralGroupId": null,
      "locale": null,
      "email_verified": false,
      "phone_verified": false,
      "profile_verified": false,
      "isPhone": null,
      "data": null,
      "otp": false,
      "enabled2fa": false,
      "secret2fa": "",
      "googleIdentity": false,
      "softban": false,
      "createdAt": "2024-02-13T18:50:17.000Z",
      "updatedAt": "2024-04-12T08:44:05.000Z"
    },
    "permissions": [
      "editCurrency",
      "viewCurrencies"
    ],
    "token": "eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3MTU1MDM2NTcsInN1YiI6InNlc3Npb24iLCJpc3MiOiJtYXJpb25ldHRlIiwiYXVkIjpbIm1hcmlvbmV0dGUiXSwianRpIjoiYjBlYmViYTUtNzliMS00ZTI4LWIyMmUtYmEwZWQxYzM2MzVkIiwidWlkIjoiODcyYTljMzJkYjQ1NDVlOGFjNzMxNTUxZmI2MWMyMjciLCJlbWFpbCI6ImJ1c2luZXNzYW5hbHlzdEBtYXJpb25ldHRlLmRldiIsInJvbGUiOiJhZG1pbiIsImxldmVsIjozLCJzdGF0ZSI6ImFjdGl2ZSIsInJlZmVycmFsX2lkIjpudWxsfQ.2meEWB_-1J1veu86q201--x5NduugDMRHWX_vwActqsyz_62RhkXICU41J9g8A6TzxoaYPncxdEypvnzIFunz6Xvx70JM-03cCPsJ74Lz6LGNt2KApkNkuJ_vdMVzqtpVp-RxNnylnqgwtHISjShEtBs8cCVvXWTfGJYh_FvC6AWccZt8hI6sHNzP3yVhz13BPJlejOYF4OYyh3iNPXlj3PkT9lfm7szyuWrBCD4gLKtABhzj2W8VWJOuhTmv8M4yw5teCH5rxobL9838r8qEcOsm6SM6fSmyVtpbxcdI8K0b1UJWcxhY5D0SYKWCLSd4n4GBA9ubvJVHIGFZcurqg",
    "isApiKey": false
  },
  "result": {
    "id": "ETH",
    "name": "ETHEREUM",
    "userBalanceEnable": true,
    "lightBgColor1": "#4c6fc2",
    "lightBgColor2": "#7ca5eb",
    "darkBgColor1": "#4c6fc2",
    "darkBgColor2": "#19409c",
    "lightTextColor": "#ffffff",
    "darkTextColor": "#ffffff",
    "icon_url": "https://devtunexio.sfo2.digitaloceanspaces.com/e3f46f79-a95f-40d5-bb19-3560b86de532.svg",
    "precision": 8,
    "enabled": true,
    "position": 2,
    "trading_commission_enabled": true,
    "hide": false,
    "staking_enabled": false,
    "staking_period": "*/10 * * * *",
    "staking_apr": 150,
    "last_staking_calc": 1703838600000,
    "min_staking_amount": 0.01,
    "instant_unstaking": true,
    "payout_fee": 1,
    "min_payout_fee": 0.001,
    "max_payout_fee": 1,
    "createdAt": "2023-05-10T06:21:09.000Z",
    "updatedAt": "2024-04-12T08:55:35.436Z"
  }
}
  1. There is the possibility to add a Role check node. If an employee has permission to update currency but their role is unexpected for such a workflow, it would end the workflow. However, if the role of the employee is correct, the workflow will proceed with an Action call to currencies.updateCurrency.

...

Login to Puppeteer with the credentials businessanalyst@marionette.dev and navigate to the Configurations page. Once there, locate the "Currencies" sub-menu.

Screenshot from 2024-04-12 12-28-14.pngImage Added

For example, if an employee does not have the 'superadmin' role (as indicated by the role check node), they attempt to update currency user balance enabled, hidden, and trading commission enabled.

The audit logs for such workflow will be the following:

...

Expand
titleFull Audit logs code for Workflow
Code Block
{
  "initialData": {
    "name": "ETHEREUM",
    "id": "ETH",
    "precision": 8,
    "position": 2,
    "lightBgColor1": "#4c6fc2",
    "lightBgColor2": "#7ca5eb",
    "lightTextColor": "#ffffff",
    "darkBgColor1": "#4c6fc2",
    "darkBgColor2": "#19409c",
    "darkTextColor": "#ffffff",
    "userBalanceEnable": false,
    "enabled": true,
    "hide": true,
    "trading_commission_enabled": false,
    "payout_fee": 1,
    "min_payout_fee": 0.001,
    "max_payout_fee": 1
  },
  "initialMeta": {
    "userIP": "176.120.105.193",
    "userAgent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:124.0) Gecko/20100101 Firefox/124.0",
    "method": "POST",
    "path": "api/v2/",
    "decodedUser": {
      "exp": 1715503657,
      "sub": "session",
      "iss": "marionette",
      "aud": [
        "marionette"
      ],
      "jti": "b0ebeba5-79b1-4e28-b22e-ba0ed1c3635d",
      "uid": "872a9c32db4545e8ac731551fb61c227",
      "email": "businessanalyst@marionette.dev",
      "role": "admin",
      "level": 3,
      "state": "active",
      "referral_id": null
    },
    "user": {
      "id": "872a9c32db4545e8ac731551fb61c227",
      "email": "businessanalyst@marionette.dev",
      "password": "sha256$4be643c4$1$95c93926a1850e210d379a4922c03cc7f397828e090c0cd9fac794af4447d065",
      "username": null,
      "role": "ADMIN",
      "state": "active",
      "referralId": null,
      "referralGroupId": null,
      "locale": null,
      "email_verified": false,
      "phone_verified": false,
      "profile_verified": false,
      "isPhone": null,
      "data": null,
      "otp": false,
      "enabled2fa": false,
      "secret2fa": "",
      "googleIdentity": false,
      "softban": false,
      "createdAt": "2024-02-13T18:50:17.000Z",
      "updatedAt": "2024-04-12T08:44:05.000Z"
    },
    "permissions": [
      "editCurrency",
      "viewCurrencies"
    ],
    "token": "eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3MTU1MDM2NTcsInN1YiI6InNlc3Npb24iLCJpc3MiOiJtYXJpb25ldHRlIiwiYXVkIjpbIm1hcmlvbmV0dGUiXSwianRpIjoiYjBlYmViYTUtNzliMS00ZTI4LWIyMmUtYmEwZWQxYzM2MzVkIiwidWlkIjoiODcyYTljMzJkYjQ1NDVlOGFjNzMxNTUxZmI2MWMyMjciLCJlbWFpbCI6ImJ1c2luZXNzYW5hbHlzdEBtYXJpb25ldHRlLmRldiIsInJvbGUiOiJhZG1pbiIsImxldmVsIjozLCJzdGF0ZSI6ImFjdGl2ZSIsInJlZmVycmFsX2lkIjpudWxsfQ.2meEWB_-1J1veu86q201--x5NduugDMRHWX_vwActqsyz_62RhkXICU41J9g8A6TzxoaYPncxdEypvnzIFunz6Xvx70JM-03cCPsJ74Lz6LGNt2KApkNkuJ_vdMVzqtpVp-RxNnylnqgwtHISjShEtBs8cCVvXWTfGJYh_FvC6AWccZt8hI6sHNzP3yVhz13BPJlejOYF4OYyh3iNPXlj3PkT9lfm7szyuWrBCD4gLKtABhzj2W8VWJOuhTmv8M4yw5teCH5rxobL9838r8qEcOsm6SM6fSmyVtpbxcdI8K0b1UJWcxhY5D0SYKWCLSd4n4GBA9ubvJVHIGFZcurqg",
    "isApiKey": false
  }
}

The runtimes for such workflow will be the following:

...

Expand
titleRuntime details

Code Block
{
  "initialData": {
    "name": "ETHEREUM",
    "id": "ETH",
    "precision": 8,
    "position": 2,
    "lightBgColor1": "#4c6fc2",
    "lightBgColor2": "#7ca5eb",
    "lightTextColor": "#ffffff",
    "darkBgColor1": "#4c6fc2",
    "darkBgColor2": "#19409c",
    "darkTextColor": "#ffffff",
    "userBalanceEnable": false,
    "enabled": true,
    "hide": true,
    "trading_commission_enabled": false,
    "payout_fee": 1,
    "min_payout_fee": 0.001,
    "max_payout_fee": 1
  },
  "initialMeta": {
    "userIP": "176.120.105.193",
    "userAgent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:124.0) Gecko/20100101 Firefox/124.0",
    "method": "POST",
    "path": "api/v2/",
    "decodedUser": {
      "exp": 1715503657,
      "sub": "session",
      "iss": "marionette",
      "aud": [
        "marionette"
      ],
      "jti": "b0ebeba5-79b1-4e28-b22e-ba0ed1c3635d",
      "uid": "872a9c32db4545e8ac731551fb61c227",
      "email": "businessanalyst@marionette.dev",
      "role": "admin",
      "level": 3,
      "state": "active",
      "referral_id": null
    },
    "user": {
      "id": "872a9c32db4545e8ac731551fb61c227",
      "email": "businessanalyst@marionette.dev",
      "password": "sha256$4be643c4$1$95c93926a1850e210d379a4922c03cc7f397828e090c0cd9fac794af4447d065",
      "username": null,
      "role": "ADMIN",
      "state": "active",
      "referralId": null,
      "referralGroupId": null,
      "locale": null,
      "email_verified": false,
      "phone_verified": false,
      "profile_verified": false,
      "isPhone": null,
      "data": null,
      "otp": false,
      "enabled2fa": false,
      "secret2fa": "",
      "googleIdentity": false,
      "softban": false,
      "createdAt": "2024-02-13T18:50:17.000Z",
      "updatedAt": "2024-04-12T08:44:05.000Z"
    },
    "permissions": [
      "editCurrency",
      "viewCurrencies"
    ],
    "token": "eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3MTU1MDM2NTcsInN1YiI6InNlc3Npb24iLCJpc3MiOiJtYXJpb25ldHRlIiwiYXVkIjpbIm1hcmlvbmV0dGUiXSwianRpIjoiYjBlYmViYTUtNzliMS00ZTI4LWIyMmUtYmEwZWQxYzM2MzVkIiwidWlkIjoiODcyYTljMzJkYjQ1NDVlOGFjNzMxNTUxZmI2MWMyMjciLCJlbWFpbCI6ImJ1c2luZXNzYW5hbHlzdEBtYXJpb25ldHRlLmRldiIsInJvbGUiOiJhZG1pbiIsImxldmVsIjozLCJzdGF0ZSI6ImFjdGl2ZSIsInJlZmVycmFsX2lkIjpudWxsfQ.2meEWB_-1J1veu86q201--x5NduugDMRHWX_vwActqsyz_62RhkXICU41J9g8A6TzxoaYPncxdEypvnzIFunz6Xvx70JM-03cCPsJ74Lz6LGNt2KApkNkuJ_vdMVzqtpVp-RxNnylnqgwtHISjShEtBs8cCVvXWTfGJYh_FvC6AWccZt8hI6sHNzP3yVhz13BPJlejOYF4OYyh3iNPXlj3PkT9lfm7szyuWrBCD4gLKtABhzj2W8VWJOuhTmv8M4yw5teCH5rxobL9838r8qEcOsm6SM6fSmyVtpbxcdI8K0b1UJWcxhY5D0SYKWCLSd4n4GBA9ubvJVHIGFZcurqg",
    "isApiKey": false
  }
}

As we can see, if an employee does not have the role that is being checked in the workflow, then the workflow will end without any action calls.

Creation Process

  1. Steps for Requester

    • Initiating a Creation Request

    • Providing Necessary Information

  2. Steps for Approver

    • Reviewing the Request

    • Approving or Rejecting the Request

...