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.
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.
Hi,
I am in process of writing custom app to enhance mojoPortal functionality for my custom need.
I am able to implement both HelloMojo user and site control app following your docs in site.
My app is associate with user role.I want to be able to do crud operation on user A that are not visible to user B.
What are the classes or modules I need to use or look at to achieve this feature.
Any high level steps or sample code will be appreciated.
If I understand your question correctly, it sounds like you might find use in the mojoPortal.Business.WebHelpers.WebUser class. It contains methods for IsInRole() and IsInRoles().
Hope that helps.
Yes I just need to able to get user role information from my custom Hellow User Module or site module?
How do I invoke that method from that class?
First add the following using statement to your code behind file if you do not already have it:
using mojoPortal.Business.WebHelpers;
All the methods and properties of the WebUser class are static, so you would just call them in the following fashion:
if(WebUser.IsInRole("Desired Role")){ ...}
Where 'WebUser' is getting information about the current user.
For a good example of how it is used, you can view the cs code behind file for MemberList.aspx.cs that resides in the root of the mojoPortal.Web project of the source code. The main use of the WebUser class resides in the LoadSettings() method.
Kerry
Thanks Kerry for prompt response that is what I need at moment.
Will come with more questions if I get stuck.Have a nice day and happy holiday season to you.