coder / coder/internal

Implement notifications RBAC role

未关闭
#2 2 条评论 0 个 reaction 已指派 1 人 已被 @dannykopping 认领 在 GitHub 查看
project/notifications
主要语言
没有语言数据
星标
3
派生
0
PR 合并指标
30 天内没有已合并 PR

描述

There are a number of TODOs in the `notifications` package around RBAC.

@Emyrk gave us some pointers on how to implement this:

> Add a new resource like template here: https://github.com/coder/coder/blob/769ac83729fb642d61538f871889d5161e0136fa/coderd/rbac/policy/policy.go#L130-L139
It will autogen in some files.
Copy this RBACObject from File pretty much exactly:
https://github.com/coder/coder/blob/769ac83729fb642d61538f871889d5161e0136fa/coderd/database/modelmethods.go#L208-L212

---

> With those 2 things, the rbac should just work. As all users by default get allPermsExcept() here: https://github.com/coder/coder/blob/769ac83729fb642d61538f871889d5161e0136fa/coderd/rbac/roles.go#L246-L246
So the notificaton resource will be appended automatically. The WithOwner() scopes the resource to the user

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。