diff --git a/scribeengine/controllers/blog.py b/scribeengine/controllers/blog.py index 349270d..ef2b09d 100644 --- a/scribeengine/controllers/blog.py +++ b/scribeengine/controllers/blog.py @@ -71,6 +71,7 @@ class BlogController(BaseController): c.page_title = c.post.title return render(u'/blog/view.mako') + @authenticate() def comment_POST(self, id): if not id: h.flash.set_message(u'There was a problem submitting your comment.', u'error') diff --git a/scribeengine/controllers/post.py b/scribeengine/controllers/post.py index b8bd3d8..d187a31 100644 --- a/scribeengine/controllers/post.py +++ b/scribeengine/controllers/post.py @@ -47,7 +47,7 @@ class PostController(BaseController): c.post = Session.query(Post).get(id) c.page_title = 'Edit Post: %s' % c.post.title return render(u'/post/edit.mako') - + @authenticate(u'Edit My Posts') def edit_POST(self, id=None): url = utils.generate_url(c.form_values[u'title']) diff --git a/scribeengine/templates/base.mako b/scribeengine/templates/base.mako index 4f127d2..514cbe5 100644 --- a/scribeengine/templates/base.mako +++ b/scribeengine/templates/base.mako @@ -20,10 +20,12 @@
  • ${page.name}
  • % endfor % if c.current_user: -
  • New Post
  • -
  • Logout
  • +% if c.current_user.has_permission('Add Posts'): +
  • New Post
  • +% endif +
  • Logout
  • % else: -
  • Login
  • +
  • Login
  • % endif