how can i check user Role Permissions for module in code?

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
6/5/2013 3:12:02 PM
Gravatar
Total Posts 8

how can i check user Role Permissions for module in code?

friends, help me. 

I need to check in code(c#) user permission for some module, for example: check if user in "DraftEditRoles" .

 

6/6/2013 10:28:37 AM
Gravatar
Total Posts 18439

Re: how can i check user Role Permissions for module in code?

Hi,

Assuming your module control inherits from SiteModuleControl,

you need:

using mojoPortal.Business.WebHelpers;

at the top if you don't already have it.

Then you can do:

if(WebUser.IsInRoles(ModuleConfiguration.DraftEditRoles)) { // do something }

ModuleConfiguration is an instance of mojoPortal.Business.Module built into the base class SiteModuleControl

Hope that helps,

Joe

6/7/2013 1:00:19 AM
Gravatar
Total Posts 8

Re: how can i check user Role Permissions for module in code?

thank you.

You must sign in to post in the forums. This thread is closed to new posts.