For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create Policy

Create a new custom policy for project.

A policy is a reusable set of permissions (allow/deny rules over modules and actions). Policies are attached to roles; a user's effective permissions are the union of the policies on all their roles. This method creates the policy; the response returns its id.

This method is on the Hub surface (norbix.hub.membership) β€” call it from admin tooling or IaC.

These examples assume the SDK is installed and your credentials are set as environment variables β€” each client reads them automatically, so the constructors below take no arguments. See Install a Norbix SDK.

import { Norbix } from '@norbix.ai/ts';
const norbix = new Norbix();

const result = await norbix.hub.membership.createPolicy({
  policyName: 'articles-editor',
  description: 'Read and write access to the articles collection.',
  policyDocumentJson: '{"allow":["articles:read","articles:write"]}',
});
using Norbix.Sdk;
using Norbix.Sdk.Types.Hub;

using var client = new NorbixClient();

var result = await client.Membership.CreatePolicyAsync(new CreatePolicy
{
    PolicyName = "articles-editor",
    Description = "Read and write access to the articles collection.",
    PolicyDocumentJson = "{\"allow\":[\"articles:read\",\"articles:write\"]}",
});
from norbix_python import NorbixHub

norbix = NorbixHub()

result = norbix.membership.create_policy(
    policyName="articles-editor",
    description="Read and write access to the articles collection.",
    policyDocumentJson="{\"allow\":[\"articles:read\",\"articles:write\"]}",
)

In the dashboard

Manage this visually in Norbix Cloud β€” see Membership β†’ Policies.

API reference

Full request and response for this endpoint: Create Policy.

Last updated