Skip to content

Commit bc9b7dd

Browse files
author
kitan1982
committed
Merge pull request #68 from kitan1982/rights-update
Show subject create button to anonymous with post rights
2 parents 7be1d75 + 66557a8 commit bc9b7dd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Controller/ForumController.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,7 @@ public function subjectsAction(Category $category, $page, $max)
128128
}
129129
$collection = new ResourceCollection(array($forum->getResourceNode()));
130130
$isAnon = $this->isAnon();
131-
$canCreateSubject = $this->authorization->isGranted('post', $collection) &&
132-
!$isAnon;
131+
$canCreateSubject = $this->authorization->isGranted('post', $collection);
133132
$isModerator = $this->authorization->isGranted('moderate', $collection) &&
134133
!$isAnon;
135134

@@ -149,6 +148,7 @@ public function subjectsAction(Category $category, $page, $max)
149148
* "/form/subject/{category}",
150149
* name="claro_forum_form_subject_creation"
151150
* )
151+
* @ParamConverter("authenticatedUser", options={"authenticatedUser" = true})
152152
* @Template()
153153
*
154154
* @param Category $category
@@ -176,6 +176,7 @@ public function subjectFormAction(Category $category)
176176
* "/form/category/{forum}",
177177
* name="claro_forum_form_category_creation"
178178
* )
179+
* @ParamConverter("authenticatedUser", options={"authenticatedUser" = true})
179180
* @Template()
180181
*
181182
* @param Forum $forum
@@ -201,6 +202,7 @@ public function categoryFormAction(Forum $forum)
201202
* "/category/create/{forum}",
202203
* name="claro_forum_create_category"
203204
* )
205+
* @ParamConverter("authenticatedUser", options={"authenticatedUser" = true})
204206
* @Template()
205207
* @param Forum $forum
206208
*/
@@ -232,6 +234,7 @@ public function createCategoryAction(Forum $forum)
232234
* "/subject/create/{category}",
233235
* name="claro_forum_create_subject"
234236
* )
237+
* @ParamConverter("authenticatedUser", options={"authenticatedUser" = true})
235238
* @Template("ClarolineForumBundle:Forum:subjectForm.html.twig")
236239
* @param Category $category
237240
* @throws \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException

0 commit comments

Comments
 (0)