* Tags and files for posts and writtings

* TryAssert(Title ~ H1)
This commit is contained in:
Paul Schneider 2014-09-24 16:19:23 +02:00
commit 07be6f2928
8 changed files with 102 additions and 30 deletions

View file

@ -12,6 +12,19 @@ namespace Yavsc.Controllers
{
public class BlogsApiController : Controller
{
public void Tag (long postid,string tag) {
BlogEntry e = BlogManager.GetPost (postid);
if (!Roles.IsUserInRole ("Admin")) {
string rguser = Membership.GetUser ().UserName;
if (rguser != e.UserName) {
throw new AccessViolationException (
string.Format (
"Vous n'avez pas le droit de tagger des billets du Blog de {0}",
e.UserName));
}
}
}
public static HttpStatusCodeResult RemovePost(string user, string title) {
if (!Roles.IsUserInRole ("Admin")) {
string rguser = Membership.GetUser ().UserName;