No Umbraco isn´t handling the as [HttpPost] or [HttpGet] if you follow the UmbracoAuthorizedJsonControllerimplementation you´ll find the MVC ApiContoller.
Umbraco is trying to be close to what MVC would normally do, with some modification.
Thanks Lucas, so i should still implement all attributes as necessary myself i.e. [HttpGet], [HttpPost] etc?
Would you happen to know if the [Authorise] attribute would work in Umbraco the same way it does for MVC apps or is this not necessary as UmbracoAuthorizedJsonController is already taking care of that?
Does Umbraco handle attributes for a custom section?
Hi
I have created a custom section which is built using AngularJS and Entity Framework.
I am inheriting from
UmbracoAuthorizedJsonControllerin my custom section controller.I have a method which saves some data using logic i have created within my Entity Framework class. This saves to my database successfully.
Does my method to save data need to be decorated by attributes such as
[HttpPost]or does Umbraco handle this?Hello J,
No Umbraco isn´t handling the as
[HttpPost]or[HttpGet]if you follow theUmbracoAuthorizedJsonControllerimplementation you´ll find the MVCApiContoller.Umbraco is trying to be close to what MVC would normally do, with some modification.
//L
Thanks Lucas, so i should still implement all attributes as necessary myself i.e.
[HttpGet],[HttpPost]etc?Would you happen to know if the
[Authorise]attribute would work in Umbraco the same way it does for MVC apps or is this not necessary asUmbracoAuthorizedJsonControlleris already taking care of that?No need to make a custom implementation of the attributes. You can simply ref the using of
using System.Web.Http;And there is no need for the
[Authorize]attribute when you inhrites the classUmbracoAuthorizedJsonControllerto your controller.The
UmbracoAuthorizedJsonControlleris build in to only allow authorize Umbraco users. Read more here: https://our.umbraco.com/Documentation/Reference/Routing/Authorized/#routing-requirements-for-backoffice-authenticationIf it is members you working with at the
UmbracoApiControllerand need to check authentication, then read more here: https://our.umbraco.com/Documentation/Reference/Routing/Umbraco-API-Controllers/authorization-v7is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.