This project is read-only.

how to create/define permission on screen ?

Topics: Administration, Announcements, Core, Customizing Orchard, General, Troubleshooting, Writing modules, Writing themes
Jun 18, 2012 at 11:55 AM
Edited Jun 18, 2012 at 11:58 AM

How/where do I create/define a new permission for a role?

Can anybody shed light on this?

Jun 18, 2012 at 11:59 AM

If you want to introduce a new permission, just have a look at the Blogs module's Permissions.cs. As you'll see, permissions are defined as static fields and returned as part of a list in the GetPermissions call. This list will then show up in the Edit Role screen.

Jun 18, 2012 at 12:12 PM
Edited Jun 18, 2012 at 12:12 PM


Does your suggestion imply I should poke around in the source code?

What does a user do on the screen? When I look at the figures on this page
I see nowhere for the user to define a new permission.

Jun 18, 2012 at 12:28 PM

That's correct. Think about it: imagine there actually were a screen where you could create new permissions. What would a permission imply exactly? Does it allow access to your custom controllers and actions? Or delete products? Execute a super-secret algorithm that only users in a certain role are allowed to do? Whatever the answer, it would have to be implemented by your module that exposes the permission.

Or are you simply looking to attach existing permissions to new roles?