How to get Orchard User Roles in Custom module

Topics: Administration, General, Writing modules
Jul 5, 2013 at 12:35 PM
Edited Jul 5, 2013 at 1:25 PM
I had made a custom module in orchard .In my custom module it want that only authenticated users to use its functionality I had created user using orchard.user module but i have confusion how the authentication is given to my custom module actions in controller.custom module is integrated on front side of my application.How i can authenticated users on my custom module controllers action because in my case each different user has access level different to action like some actions are for admin some actions are anonymous users
Coordinator
Jul 6, 2013 at 2:07 AM
Your module should never need to know about specific roles (there might not be any for all you know). What you do is that you create and enforce permissions, suggest stereotype associations for them, and otherwise let the site admin decide what roles should have what permissions. Look-up any module that adds permissions (that's any built-in module, pretty much) and do the same thing they do.