TagoIO SDK for JavaScript and TypeScript
    Preparing search index...

    Class Access

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Creates a new access policy in your application.

      Parameters

      Returns Promise<{ am_id: string }>

      If receive an error "Authorization Denied", check policy Access Management / Create in Access Management.

      const newAccess = await Resources.accessManagement.create({
      active: true,
      name: "My Access Policy",
      permissions: [
      {
      effect: "allow",
      action: ["access"],
      resource: ["access_management"],
      },
      ],
      targets: [["analysis", "id", "analysis-id-123"]],
      tags: [{ key: "type", value: "admin" }],
      });
      console.log(newAccess.am_id); // access-id-123
    • Removes an access policy from your application.

      Parameters

      • accessID: string

      Returns Promise<string>

      If receive an error "Authorization Denied", check policy Access Management / Delete in Access Management.

      const result = await Resources.accessManagement.delete("access-id-123");
      console.log(result); // Successfully Removed
    • Modifies an existing access policy.

      Parameters

      Returns Promise<string>

      If receive an error "Authorization Denied", check policy Access Management / Edit in Access Management.

      const result = await Resources.accessManagement.edit("access-id-123", {
      name: "Updated Access Policy",
      permissions: [
      {
      effect: "allow",
      action: ["edit"],
      resource: ["access_management"],
      },
      ],
      tags: [{ key: "type", value: "user" }]
      });
      console.log(result); // Access Management Successfully Updated
    • Lists all access rules from the application with pagination support. Use this to retrieve and manage access policies for your application.

      Parameters

      Returns Promise<AccessInfo[]>

      If receive an error "Authorization Denied", check policy Access Management / Access in Access Management.

      const result = await Resources.accessManagement.list({
      page: 1,
      fields: ["id", "name"],
      amount: 10,
      orderBy: ["name", "asc"]
      });
      console.log(result); // [ { id: 'access-id-123', name: '[Analysis] - Test', ...} ]