Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Redmine Plugin Extension and Development

You're reading from   Redmine Plugin Extension and Development If you'd like to customize Redmine to meet your own precise project management needs, this is the ideal guide to understanding and realizing the full potential of plugins. Full of real-world examples and clear instructions.

Arrow left icon
Product type Paperback
Published in Mar 2014
Publisher
ISBN-13 9781783288748
Length 114 pages
Edition Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Alex Bevilacqua Alex Bevilacqua
Author Profile Icon Alex Bevilacqua
Alex Bevilacqua
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Redmine Plugin Extension and Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Introduction to Redmine Plugins FREE CHAPTER 2. Extending Redmine Using Hooks 3. Permissions and Security 4. Attaching Files to Models 5. Making Models Searchable 6. Interacting with the Activity Stream 7. Managing Plugin Settings 8. Testing Your Plugin Releasing Your Plugin Index

Declaring custom permissions


As we saw briefly in Chapter 1, Introduction to Redmine Plugins, permissions are registered in our plugin's init.rb file as part of the Redmine::Plugin.register block.

While registering a new permission, we populate a hash, which takes a controller as key, and an array of actions as the value. The syntax for this command is as follows:

permission(name, actions, options = {})

The permission helper that is available to us (plugin authors) is actually just a wrapper around Redmine::AccessControl#map, which is located in /path/to/redmine/lib/redmine/access_control.rb.

Before registering our permissions, we need to understand the two scopes of permissions that are available: global and project module.

Global permissions are a bit deceptive as they aren't actually "global" in nature. In fact, they belong to the Project category and are essentially just a sum of a user's permissions across all projects for which they are members.

Note that global permissions can mean different...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image