how to check if a user can edit a module as draft?

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.
2/7/2012 9:19:35 AM
Gravatar
Total Posts 192

how to check if a user can edit a module as draft?

Hi. I enabled workflow in the system and then allowed a role to edit a module in draft.

now in the code I need to  know if the user can edit the module as draft( if only or not), the code is in a custom module

I tried the following

((mojoBasePage)Page).UserCanOnlyEditModuleAsDraft(ModuleId)

but this doesn't work correctly.

(the code I'm using is relatively old. it belongs to the age of mojoportal 2.3.6.6)

help please.

2/7/2012 9:48:45 AM
Gravatar
Total Posts 18439

Re: how to check if a user can edit a module as draft?

Hi,

If your page inherits from mojoBasePage you don't need to cast the page as mojoBasePage, you can just call the method directly.

This method requires passing in the featureGuid

bool userCanEditAsDraft = UserCanOnlyEditModuleAsDraft(moduleId, HtmlContent.FeatureGuid);

Hope that helps,

Joe

2/7/2012 2:26:02 PM
Gravatar
Total Posts 192

Re: how to check if a user can edit a module as draft?

sorry, the method was working properly,

in the context I was working I needed to add this code:

Title1.ShowEditLinkOverride = true;

so I could have the editlink visible.

and, I needed to cast the page, because the code was being used in a sitemodulecontrol, not in a page.

All what I'm doing is to allow multiple authors to write news in a cloned blog feature.

if you think these changes can be useful, I will provide the details of the changes.

regards.

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