/** * EACL Table - Extended Access Control List for a container. */ import { NeoFsV2Acl } from '../gen/acl/types_pb'; import { Record } from './record'; import { Target } from './target'; import { Filter } from './filter'; import { Operation } from './enums'; /** * Table represents an Extended ACL rules table for a single container. * * @example * ```typescript * // Create an EACL that allows public read but only owner can write/delete * const eacl = new Table(containerId) * .addRecord(Record.allowGet([Target.others()])) * .addRecord(Record.allowHead([Target.others()])) * .addRecord(Record.allowSearch([Target.others()])) * .addRecord(Record.denyPut([Target.others()])) * .addRecord(Record.denyDelete([Target.others()])); * * // Serialize for API calls * const bytes = eacl.serialize(); * ``` */ export declare class Table { private _containerId?; private _records; private _version; constructor(containerId?: Uint8Array); /** Container ID this EACL applies to */ get containerId(): Uint8Array | undefined; /** Set the container ID */ setContainerId(id: Uint8Array): this; /** Access control records */ get records(): Record[]; /** EACL format version */ get version(): { major: number; minor: number; }; /** Set EACL format version */ setVersion(major: number, minor: number): this; /** * Add a record to the table. */ addRecord(record: Record): this; /** * Add multiple records to the table. */ addRecords(records: Record[]): this; /** * Add an ALLOW rule. */ allow(operation: Operation, targets: Target[], filters?: Filter[]): this; /** * Add a DENY rule. */ deny(operation: Operation, targets: Target[], filters?: Filter[]): this; /** * Allow all operations for the given targets. */ allowAll(targets: Target[]): this; /** * Deny all operations for the given targets. */ denyAll(targets: Target[]): this; /** * Allow read operations (GET, HEAD, SEARCH, RANGE, RANGE_HASH) for the given targets. */ allowRead(targets: Target[]): this; /** * Deny read operations for the given targets. */ denyRead(targets: Target[]): this; /** * Allow write operations (PUT, DELETE) for the given targets. */ allowWrite(targets: Target[]): this; /** * Deny write operations for the given targets. */ denyWrite(targets: Target[]): this; /** * Convert to protobuf message. */ toProto(): NeoFsV2Acl.EACLTableImpl; /** * Serialize to binary format. */ serialize(): Uint8Array; /** * Create Table from protobuf message. */ static fromProto(proto: NeoFsV2Acl.EACLTable): Table; /** * Deserialize from binary format. */ static deserialize(data: Uint8Array): Table; /** * Clone this table. */ clone(): Table; } /** * Create a public-read EACL (anyone can read, only owner can write). */ export declare function publicReadEACL(containerId?: Uint8Array): Table; /** * Create a private EACL (only owner can access). */ export declare function privateEACL(containerId?: Uint8Array): Table; /** * Create a public EACL (anyone can read and write). */ export declare function publicEACL(containerId?: Uint8Array): Table; /** * Create an EACL that allows specific users to access. */ export declare function allowUsersEACL(userIds: Uint8Array[], containerId?: Uint8Array): Table;