Custom Events & News form for non admin users

Posted by Community Admin on 04-Aug-2018 08:33

Custom Events & News form for non admin users

All Replies

Posted by Community Admin on 03-Aug-2012 00:00
Hi,

We are in the process of creating an intranet for a client and two of their requirements are to have an events page where staff can post their own events and a classified section where they can post things such as items for sale etc...

Because none of the staff will have a login I was hoping to create a form in a user control that any staff can submit and using the fluent API (http://www.sitefinity.com/documentation/documentationarticles/developers-guide/sitefinity-essentials/modules/events/creating-events) and add it to the database in the events section. 

I was also going to do the same for the classifieds but use the news module and assign it to a classifieds category.

Does this sound the right way of doing this or can anyone suggest any alternatives?

Thanks
Richard
Posted by Community Admin on 13-Dec-2012 00:00
Hello,

We have answer you on the support ticket you have opened. I will share our answer with the community.

This approach is completely valid. You get all the needed information for the event from the form you will create and then pass that to the API and it will create the event for you in the database and the backend. However there is a thing that you must keep in mind - since the users will not have backend credentials, you need to supress security checks in the code to allow unauthenticated users to submit that code. Unfortunately you will need to use the Native API as in the Fluent one, there is no way you can get the Manager and then the provider in order to set the SuppressSecurityChecks to true. You can use the native API sample from the documentation and just add the SuppressSecurityChecks like so:

EventsManager eventsManager = new EventsManager();
eventsManager.Provider.SuppressSecurityChecks = true;

That way unauthorized users will be able to create the events as per your requirements. The same is valid for the NewsItem as well and you can utilize the same approach.

Kind regards,
Stefani Tacheva
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
This thread is closed