Trac 工作流阻塞

发布于 2024-08-09 18:59:21 字数 103 浏览 4 评论 0原文

有没有办法根据用户角色阻止给定的更改?

例如,我不希望任何开发人员能够将票证状态从“开发”更改为“已关闭”。我希望它经过“测试”,并允许“测试”仅对具有测试角色的用户“关闭”。

Is there a way to block a given change based on the user role?

For example, I don't want any developer to be able to change a ticket status from 'development' to 'closed'. I want it to go through 'test', and allow 'test' to 'closed' only to users with the test role.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

煮酒 2024-08-16 18:59:21

这是对 Trac 工作流程的非常简单的调整。下面引用了添加可选测试的文档:

通过将以下内容添加到您的
trac.ini 的 [ticket-workflow] 部分
您可以进行可选测试。当
机票是新的、已接受的或
您可以选择的 need_work 状态
提交进行测试。当它在
用户获得的测试状态
可以选择拒绝并将其退回
需要工作,或通过测试并
将其发送至关闭。如果他们
接受它然后它会自动获得
标记为已关闭,决议为
设置为固定。由于所有旧工作
流量仍然存在,票可以跳过此
整个部分。

testing = new,accepted,needs_work,assigned,reopened -> testing
testing.name = Submit to reporter for testing
testing.permissions = TICKET_MODIFY

reject = testing -> needs_work
reject.name = Failed testing, return to developer

pass = testing -> closed
pass.name = Passes Testing
pass.operations = set_resolution
pass.set_resolution = fixed

现在,所有门票在进入“通过”状态之前都必须经过“测试”状态。

为了确保只有某些测试人员可以将票证从“测试”更改为“通过”,请创建一个名为 TICKET_PASS 的新权限(trac 管理员可以在 Web UI 中执行此操作),并将以下内容添加到 trac 的工作流程部分.ini:

pass.permissions = TICKET_PASS

恕我直言,只需要求票证在通过之前经过测试就足够了。任何理性的开发人员都知道,他们不应该将票证从“测试”状态转移到“通过”状态,除非它通过了您所做的任何质量控制。由于他们的行为有历史记录,他们可能会因为不恰当地将门票标记为“通行证”而受到指责。限制权限可能会带来更多麻烦(分散 trac 管理员的注意力),而不是有帮助。

[注意:我必须删除除其中一个文档超链接之外的所有内容,因为我的代表太低了。叹。]

This is pretty straightforward tweak to the Trac Workflow. The documentation for adding optional testing is quoted below:

By adding the following to your
[ticket-workflow] section of trac.ini
you get optional testing. When the
ticket is in new, accepted or
needs_work status you can choose to
submit it for testing. When it's in
the testing status the user gets the
option to reject it and send it back
to needs_work, or pass the testing and
send it along to closed. If they
accept it then it gets automatically
marked as closed and the resolution is
set to fixed. Since all the old work
flow remains, a ticket can skip this
entire section.

testing = new,accepted,needs_work,assigned,reopened -> testing
testing.name = Submit to reporter for testing
testing.permissions = TICKET_MODIFY

reject = testing -> needs_work
reject.name = Failed testing, return to developer

pass = testing -> closed
pass.name = Passes Testing
pass.operations = set_resolution
pass.set_resolution = fixed

Now all tickets must go through the "testing" state before the "pass" state.

To ensure that only certain testers can change a ticket from "testing" to "pass", create a new permission called TICKET_PASS (the trac admin can do this in the web UI), and add the following to your the workflow section of your trac.ini:

pass.permissions = TICKET_PASS

IMHO, it's sufficient to just require that tickets go through testing before they pass. Any reasonable developer knows that they shouldn't move a ticket from the "testing" state to the "passing" state unless it's passed whatever quality control you do. And since there's a history of their actions, they can be blamed for inappropriately marking tickets as "pass". Restricting the privileges will probably get in the way (distracting the trac admin) more than it helps.

[NB: I had to remove all but one of the hyperlinks to documentation b/c my rep is too low. Sigh.]

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文