* Web.csproj:

* Profile.aspx:
* MyProfile.aspx:
* AccountController.cs: renamed the Profile method to "MyProfile",
  could avoid issue at migrating to MVC5

* favicon.png: favicon now displays a ~"Yavsc"

* BlogManager.cs:
* BlogsApiController.cs: The authorisation for removing a post is now
  implemented at Manager's side

* BlogsController.cs: Removes this odd call to a static method from
  the Api controller

* CalendarApi.cs:
* GoogleController.cs: no more json output for the calls to the Google
  Api

* WorkFlowController.cs: sorted using clauses

* Basket.cs:
* Commande.cs:
* EstimToPdfFormatter.cs:
* Brand.cs: adds xml doc

* RssFeedsFormatter.cs: modifies xml doc

* TexToPdfFormatter.cs: refactoring

* Global.asax.cs: Document formatting

* BBCodeHelper.cs: encapsulates the url display from the BBCode in
  starting and closing characters : "<>"

* OAuth2.cs:
* SimpleJsonPostMethod.cs: using System.Runtime.Serialization.Json
  instead of Newtonsof.Json

* App.master: updating the favicon

* RegistrationPending.aspx: fixes the returnUrl usage

* AssemblyInfo.aspx: better explanation for this list

* Web.config: tried to migrate to MVC5 (using NuGets)

* Estim.cs:
* ChangePasswordModel.cs: adds xmldoc

* BasketController.cs:
* BlogProvidersConfigurationSection.cs: cosmetic change

* GoogleErrorMessage.cs: - adds xml docs
- renders ctor from JsonReaderException obsolete

* MvcActionValueBinder.cs: not used

* web.config: no more used, gave it up to migrate to MVC5
This commit is contained in:
Paul Schneider
2015-02-12 16:08:16 +01:00
parent a342b744df
commit e676d2fdbf
31 changed files with 250 additions and 238 deletions

View File

@ -2,6 +2,7 @@ using System;
using Yavsc.Model.Blogs;
using Yavsc.Model.RolesAndMembers;
using System.Web;
using System.Web.Security;
namespace Yavsc.Model.Blogs
@ -49,6 +50,15 @@ namespace Yavsc.Model.Blogs
}
public static void RemovePost (string username, string title)
{
if (!Roles.IsUserInRole ("Admin")) {
string rguser = Membership.GetUser ().UserName;
if (rguser != username) {
throw new AccessViolationException (
string.Format (
"{1}, Vous n'avez pas le droit de suprimer des billets du Blog de {0}",
username,rguser));
}
}
Provider.RemovePost (username, title);
}
public static BlogEntryCollection LastPosts (int pageIndex, int pageSize, out int totalRecords)