> For the complete documentation index, see [llms.txt](https://gabriel-j-shapiro.gitbook.io/metalex-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gabriel-j-shapiro.gitbook.io/metalex-docs/protocol-how-to-guides/configure-roles.md).

# Configure BorgAuth roles

Authority on a cyberCORP is held in its **BorgAuth** ACL. Roles are numeric levels in a hierarchy — see [Access control](/metalex-docs/protocol-reference/access-control.md).

## The levels you'll use

| Level               | Meaning                                                                                       |
| ------------------- | --------------------------------------------------------------------------------------------- |
| `99` (`OWNER_ROLE`) | Owner. Can grant/revoke roles. Held by the suite's manager contracts.                         |
| `200`               | Company officer. Set for an officer's address; `200 ≥ 99`, so officers also pass `onlyOwner`. |
| `0`                 | No authority.                                                                                 |

## Grant an officer

The simplest path is `CyberCorp.addOfficer`, which records the officer **and** grants their address level `200`:

```solidity
import {CompanyOfficer} from "src/CyberCorpConstants.sol";

CyberCorp(cyberCorp).addOfficer(CompanyOfficer({
    eoa:     newOfficer,
    name:    "Sam Officer",
    contact: "sam@acme.example",
    title:   "Chief Financial Officer"
}));
```

## Remove an officer

Either removes the officer record and sets their level back to `0`:

```solidity
CyberCorp(cyberCorp).removeOfficer(departedOfficer);
// or by index:
CyberCorp(cyberCorp).removeOfficerAt(2);
```

## Grant or revoke a role directly

To set any level directly, call `updateRole` on the BorgAuth contract. The caller must hold `OWNER_ROLE`.

```solidity
BorgAuth auth = BorgAuth(BorgAuthACL(cyberCorp).AUTH());
auth.updateRole(someAddress, 200);   // grant officer level
auth.updateRole(someAddress, 0);     // revoke
```

## Transfer ownership

Two-step, on the BorgAuth contract:

```solidity
auth.initTransferOwnership(newOwner);   // by current owner
// then, as newOwner:
auth.acceptOwnership();
```

## Renounce

`auth.zeroOwner()` sets the caller's level to `0`, permanently removing its admin control.

## Related

* [Access control reference](/metalex-docs/protocol-reference/access-control.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://gabriel-j-shapiro.gitbook.io/metalex-docs/protocol-how-to-guides/configure-roles.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
