Resources
Policies
Create, inspect, update and delete Grantex access policies with the Go SDK. Review request types and examples before changing authorization rules.
Last modified on August 29, 2026
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Create, inspect, update and delete Grantex access policies with the Go SDK. Review request types and examples before changing authorization rules.
pol, err := client.Policies.Create(ctx, grantex.CreatePolicyParams{
Name: "Block after hours",
Effect: "deny",
TimeOfDayStart: "18:00",
TimeOfDayEnd: "08:00",
Scopes: []string{"write:data"},
})
result, err := client.Policies.List(ctx)
pol, err := client.Policies.Get(ctx, "policy-id")
name := "Updated Policy"
effect := "allow"
pol, err := client.Policies.Update(ctx, "policy-id", grantex.UpdatePolicyParams{
Name: &name,
Effect: &effect,
})
err := client.Policies.Delete(ctx, "policy-id")
Policy| Field | Type | Description |
|---|---|---|
ID | string | Policy ID |
Name | string | Policy name |
Effect | string | "allow" or "deny" |
Priority | int | Evaluation priority |
AgentID | *string | Scope to specific agent |
PrincipalID | *string | Scope to specific user |
Scopes | []string | Affected scopes |
TimeOfDayStart | *string | Start time (HH:MM) |
TimeOfDayEnd | *string | End time (HH:MM) |
CreatedAt | string | ISO 8601 timestamp |
UpdatedAt | string | ISO 8601 timestamp |