Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Commit

Permalink
WIP #132 Rename 'canPostTopic' to 'canPostTopics'
Browse files Browse the repository at this point in the history
  • Loading branch information
JN-Jones committed May 21, 2015
1 parent f7999c8 commit dc88d8d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/TopicController.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ public function create($forumId, Request $request, MessageFormatter $formatter)

$this->breadcrumbs->setCurrentRoute('topics.create', $forum);

if (!$this->permissionChecker->hasPermission('forum', $forum->id, 'canPostTopic')) {
if (!$this->permissionChecker->hasPermission('forum', $forum->id, 'canPostTopics')) {
throw new AccessDeniedHttpException;
}

Expand Down Expand Up @@ -431,7 +431,7 @@ public function postCreate($forumId, CreateRequest $createRequest)
{
// Forum permissions are checked in "CreateRequest"

if (!$this->permissionChecker->hasPermission('forum', $forumId, 'canPostTopic')) {
if (!$this->permissionChecker->hasPermission('forum', $forumId, 'canPostTopics')) {
throw new AccessDeniedHttpException;
}

Expand Down
4 changes: 2 additions & 2 deletions database/seeds/PermissionRoleTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ public function run()
'content_id' => null
],
[
'permission_id' => $this->perm('canPostTopic'),
'permission_id' => $this->perm('canPostTopics'),
'role_id' => $this->role('guest'),
'value' => PermissionChecker::NO,
'content_id' => 0
],
[
'permission_id' => $this->perm('canPostTopic'),
'permission_id' => $this->perm('canPostTopics'),
'role_id' => $this->role('banned'),
'value' => PermissionChecker::NO,
'content_id' => 0
Expand Down
2 changes: 1 addition & 1 deletion database/seeds/PermissionsTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function run()
'default_value' => PermissionChecker::NO
],
[
'permission_name' => 'canPostTopic',
'permission_name' => 'canPostTopics',
'content_name' => 'forum',
'default_value' => PermissionChecker::YES
],
Expand Down
2 changes: 1 addition & 1 deletion resources/views/forum/show.twig
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<div class="page-buttons">
<a href="#" class="button button--secondary"><i class="fa fa-circle-o"></i><span class="text">{{ trans('forum.markread') }}</span></a>
<a href="#" class="button button--secondary"><i class="fa fa-plus"></i><span class="text">{{ trans('forum.follow') }}</span></a>
{% if forum.hasPermission('canPostTopic') %}
{% if forum.hasPermission('canPostTopics') %}
<a href="{{ url_route("topics.create", [forum.id]) }}" class="button"><i class="fa fa-edit"></i><span class="text">{{ trans('forum.posttopic') }}</span></a>
{% endif %}
</div>
Expand Down

0 comments on commit dc88d8d

Please sign in to comment.