[core] rename FORUM_CREATE permission
This permission is for more than creating threads, making the previous name misleading
This commit is contained in:
parent
3f064c3336
commit
ac86cb1302
3 changed files with 6 additions and 6 deletions
|
@ -120,7 +120,7 @@ abstract class Permissions
|
||||||
public const BYPASS_IMAGE_APPROVAL = "bypass_image_approval";
|
public const BYPASS_IMAGE_APPROVAL = "bypass_image_approval";
|
||||||
|
|
||||||
public const FORUM_ADMIN = "forum_admin";
|
public const FORUM_ADMIN = "forum_admin";
|
||||||
public const FORUM_CREATE_THREAD = "forum_create_thread";
|
public const FORUM_CREATE = "forum_create";
|
||||||
|
|
||||||
public const NOTES_ADMIN = "notes_admin";
|
public const NOTES_ADMIN = "notes_admin";
|
||||||
public const NOTES_CREATE = "notes_create";
|
public const NOTES_CREATE = "notes_create";
|
||||||
|
|
|
@ -116,7 +116,7 @@ new UserClass("user", "base", [
|
||||||
Permissions::PERFORM_BULK_ACTIONS => true,
|
Permissions::PERFORM_BULK_ACTIONS => true,
|
||||||
Permissions::BULK_DOWNLOAD => true,
|
Permissions::BULK_DOWNLOAD => true,
|
||||||
Permissions::CHANGE_USER_SETTING => true,
|
Permissions::CHANGE_USER_SETTING => true,
|
||||||
Permissions::FORUM_CREATE_THREAD => true,
|
Permissions::FORUM_CREATE => true,
|
||||||
Permissions::NOTES_CREATE => true,
|
Permissions::NOTES_CREATE => true,
|
||||||
Permissions::NOTES_EDIT => true,
|
Permissions::NOTES_EDIT => true,
|
||||||
Permissions::POOLS_CREATE => true,
|
Permissions::POOLS_CREATE => true,
|
||||||
|
|
|
@ -102,7 +102,7 @@ class Forum extends Extension
|
||||||
if ($event->page_matches("forum/index", paged: true)) {
|
if ($event->page_matches("forum/index", paged: true)) {
|
||||||
$pageNumber = $event->get_iarg('page_num', 1) - 1;
|
$pageNumber = $event->get_iarg('page_num', 1) - 1;
|
||||||
$this->show_last_threads($page, $pageNumber, $user->can(Permissions::FORUM_ADMIN));
|
$this->show_last_threads($page, $pageNumber, $user->can(Permissions::FORUM_ADMIN));
|
||||||
if (!$user->can(Permissions::FORUM_CREATE_THREAD)) {
|
if (!$user->can(Permissions::FORUM_CREATE)) {
|
||||||
$this->theme->display_new_thread_composer($page);
|
$this->theme->display_new_thread_composer($page);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ class Forum extends Extension
|
||||||
if ($user->can(Permissions::FORUM_ADMIN)) {
|
if ($user->can(Permissions::FORUM_ADMIN)) {
|
||||||
$this->theme->add_actions_block($page, $threadID);
|
$this->theme->add_actions_block($page, $threadID);
|
||||||
}
|
}
|
||||||
if (!$user->can(Permissions::FORUM_CREATE_THREAD)) {
|
if (!$user->can(Permissions::FORUM_CREATE)) {
|
||||||
$this->theme->display_new_post_composer($page, $threadID);
|
$this->theme->display_new_post_composer($page, $threadID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -128,7 +128,7 @@ class Forum extends Extension
|
||||||
}
|
}
|
||||||
if ($event->page_matches("forum/create")) {
|
if ($event->page_matches("forum/create")) {
|
||||||
$redirectTo = "forum/index";
|
$redirectTo = "forum/index";
|
||||||
if (!$user->can(Permissions::FORUM_CREATE_THREAD)) {
|
if (!$user->can(Permissions::FORUM_CREATE)) {
|
||||||
$errors = $this->sanity_check_new_thread();
|
$errors = $this->sanity_check_new_thread();
|
||||||
|
|
||||||
if (count($errors) > 0) {
|
if (count($errors) > 0) {
|
||||||
|
@ -167,7 +167,7 @@ class Forum extends Extension
|
||||||
if ($event->page_matches("forum/answer")) {
|
if ($event->page_matches("forum/answer")) {
|
||||||
$threadID = int_escape($event->req_POST("threadID"));
|
$threadID = int_escape($event->req_POST("threadID"));
|
||||||
$total_pages = $this->get_total_pages_for_thread($threadID);
|
$total_pages = $this->get_total_pages_for_thread($threadID);
|
||||||
if (!$user->can(Permissions::FORUM_CREATE_THREAD)) {
|
if (!$user->can(Permissions::FORUM_CREATE)) {
|
||||||
$errors = $this->sanity_check_new_post();
|
$errors = $this->sanity_check_new_post();
|
||||||
|
|
||||||
if (count($errors) > 0) {
|
if (count($errors) > 0) {
|
||||||
|
|
Reference in a new issue