[英]Redmine plugin application-wide permissions
I'm writing a plugin for Redmine 2.0.1. 我正在为Redmine 2.0.1编写插件。 While I have most of the requirements already fulfilled, I'm struggling with the permissions for the plugin. 虽然我已经满足了大多数要求,但是我却在为插件的权限苦苦挣扎。
The plugin itself is "global" in terms of Redmine, ie it project-independent. 就Redmine而言,插件本身是“全局的”,即与项目无关。 Is there any Redmine-instance-wide permissions system, or just the project-related permissions system? 是否有Redmine实例范围的权限系统,或仅与项目相关的权限系统?
It lasted quite a long time, but I finally managed to find a solution. 它持续了很长时间,但我终于设法找到了解决方案。 If you're interested, here's what I did. 如果您有兴趣,这就是我所做的。
1) Create new model with the boolean permissions that you need 2) Create a User patch, so that User model now has the permissions. 1)使用所需的布尔权限创建新模型2)创建用户补丁程序,以便用户模型现在具有权限。 Example is here 3) Update the user edit template, so that it contains the custom permission 4) Use the permission anywhere you like. 示例在此处 3)更新用户编辑模板,使其包含自定义权限4)在所需的任何位置使用该权限。
HTH 高温超导
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.