Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have a situation whereby many users have access to create forms in Contour. However, due to the Contour security only the creator can see the forms unless an admin user checks the relevant box to allow access.
Is there anyway where I can automate this step or just have all Contour forms available to all users?
Yup you can automate this, there is an event available on form create, will post some details tomorrow
Umbraco.Forms.Data.Storage.FormStorage has an FormCreated event that you can use
You can then use the UserFormSecurityStorage part to set the security for the newly created form
I've got it working. Thanks for your help in pointing me in the right direction.
Just posting this code should it help anybody else.
I created the following class in the App_Code folder
/// Class for custom Contour Events
public class ContourEvents : ApplicationBase
FormStorage.FormCreated += new EventHandler(FormStorage_FormCreated);
void FormStorage_FormCreated(object sender, FormEventArgs e)
void AllowAccessForAllUsers(FormEventArgs form)
var userFormSecurityStorage = new UserFormSecurityStorage();
// loop through all users and allow access
User users = User.getAll();
foreach (User user in users)
UserFormSecurity userFormSecurity = new UserFormSecurity();
userFormSecurity.User = user.Id; // this needs to be Id, not just user
userFormSecurity.HasAccess = true;
userFormSecurity.Form = form.Form.Id;
userFormSecurity.SecurityType = global::Umbraco.Forms.Core.Enums.FormSecurityType.Full;
Dont know if this issue is still open or not, but I'm getting an intellisense error message when I create the class in the appcode folder and copy paste this code. The error says "No overload for FromStorageFormCreated matches delegate 'eventHandler'". I'm assuming that i'm missing something.
Help would be nice.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted