Method to check the permissions/roles of a user

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.
5/6/2010 11:40:12 AM
Gravatar
Total Posts 8

Method to check the permissions/roles of a user

Hi

I'm creating a new module in my mojoPortal implementation, but I would like to know if there's a method, or something that returns me to which roles a user belongs to. In this way I can display certain information on the module depending on the permissions.

Hope that makes sense.

 

Thanks

 

David E.

5/6/2010 2:49:11 PM
Gravatar
Total Posts 18439

Re: Method to check the permissions/roles of a user

Hi David,

You should study the code of existing features and you will see many places where we check roles and other common tasks.

For the current user you can use

if(WebUser.IsInRoles(semicolonseparatedlistofallowedroles))
{ // do something}

Hope it helps,

Joe

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