---
order: 1
title: 开始使用
type: Guide
---

### 1. 安装依赖
```bash
yarn add @bixi/ac
```

### 2. 注册模块

```typescript
import { BixiACModule } from '@bixi/ac';

@NgModule({
  imports: [BixiACModule]
})
export class AppModule { }
```

### 3. 配置权限

```typescript
import { BixiACService } from '@bixi/ac';

// 应用启动时
this.acService.setPermissions([
  'app.view',
  'app.edit',
  'app.delete'
]);
```

### 4. 控制访问

* [通过指令控制区块的显示](/ac/directive)

* [通过守卫控制路由的加载](/ac/guard)

* [通过编程的方式进行控制](/ac/service)
