Skip to content

Commit 7eda208

Browse files
committed
Minor API fix
1 parent 5df41f2 commit 7eda208

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
using SmartStore.Services;
2020
using SmartStore.Services.Directory;
2121
using SmartStore.Services.Localization;
22+
using SmartStore.Web.Framework.WebApi.Security;
2223

2324
namespace SmartStore.Web.Framework.WebApi
2425
{
@@ -43,6 +44,7 @@ protected internal HttpResponseException ExceptionNotExpanded<TProperty>(Express
4344
return new HttpResponseException(response);
4445
}
4546

47+
[WebApiAuthenticate]
4648
public override HttpResponseMessage HandleUnmappedRequest(ODataPath odataPath)
4749
{
4850
if (odataPath.PathTemplate.IsCaseInsensitiveEqual("~/entityset/key/property") ||
@@ -172,6 +174,7 @@ public virtual ICommonServices Services
172174
set;
173175
}
174176

177+
[WebApiAuthenticate]
175178
public override IQueryable<TEntity> Get()
176179
{
177180
if (!ModelState.IsValid)
@@ -344,6 +347,7 @@ protected internal virtual SingleResult<TElement> GetRelatedEntity<TElement>(
344347
return SingleResult.Create(query);
345348
}
346349

350+
[WebApiAuthenticate]
347351
public override HttpResponseMessage Post(TEntity entity)
348352
{
349353
var response = Request.CreateResponse(HttpStatusCode.OK, CreateEntity(entity));
@@ -380,6 +384,7 @@ protected internal virtual void Insert(TEntity entity)
380384
Repository.Insert(entity);
381385
}
382386

387+
[WebApiAuthenticate]
383388
public override HttpResponseMessage Put(int key, TEntity update)
384389
{
385390
return Request.CreateResponse(HttpStatusCode.OK, UpdateEntity(key, update));
@@ -411,6 +416,7 @@ protected internal virtual void Update(TEntity entity)
411416
Repository.Update(entity);
412417
}
413418

419+
[WebApiAuthenticate]
414420
public override HttpResponseMessage Patch(int key, Delta<TEntity> patch)
415421
{
416422
return Request.CreateResponse(HttpStatusCode.OK, PatchEntity(key, patch));
@@ -431,6 +437,7 @@ protected override TEntity PatchEntity(int key, Delta<TEntity> patch)
431437
return entity;
432438
}
433439

440+
[WebApiAuthenticate]
434441
public override void Delete(int key)
435442
{
436443
if (!ModelState.IsValid)

0 commit comments

Comments
 (0)