简体   繁体   English

Redmine插件应用程序范围的权限

[英]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.

相关问题 应用程序范围内的jQuery脚本 - application-wide jquery script Rails + SSL:每个控制器还是应用程序范围? - Rails + SSL: Per controller or application-wide? Ruby on Rails:如何生成应用程序范围的序列? - Ruby on Rails : how to generate an application-wide sequence? 通过Web表单使用户可以访问应用程序范围的设置 - Make application-wide settings accessible to the user via web forms 在link_to生成的链接中添加应用程序范围的默认参数 - Adding an application-wide default parameter to link_to generated links Ruby将“ Model.all”保存到应用程序范围的变量中 - Ruby saving “Model.all” into application-wide variable 可以从Rails中的控制器获取和设置的应用程序范围的全局变量 - Application-wide global variable that can be get and set from controllers in Rails 在Rails 3.0 / 3.1中,我应该如何缓存应用程序范围内所需的不变数据? - In Rails 3.0/3.1 how should I cache unchanging data that's needed application-wide? 在应用程序范围内为simple_form设置input_html值 - Set input_html values application-wide for simple_form 在Rails中定义应用程序范围的部分及其变量的正确方法是什么 - What is the correct way to define an application-wide partial and its variables in rails
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM