Permissions to constants

This commit is contained in:
Matthew Barbour
2019-07-09 09:10:21 -05:00
committed by matthew
parent d16dfe24f2
commit cb1e9c0075
57 changed files with 323 additions and 257 deletions

View File

@@ -155,7 +155,7 @@ class Upload extends Extension
{
global $database, $page, $user;
if ($user->can("create_image")) {
if ($user->can(Permissions::CREATE_IMAGE)) {
if ($this->is_full) {
$this->theme->display_full($page);
} else {
@@ -165,7 +165,7 @@ class Upload extends Extension
if ($event->page_matches("upload/replace")) {
// check if the user is an administrator and can upload files.
if (!$user->can("replace_image")) {
if (!$user->can(Permissions::REPLACE_IMAGE)) {
$this->theme->display_permission_denied();
} else {
if ($this->is_full) {
@@ -221,7 +221,7 @@ class Upload extends Extension
}
}
} elseif ($event->page_matches("upload")) {
if (!$user->can("create_image")) {
if (!$user->can(Permissions::CREATE_IMAGE)) {
$this->theme->display_permission_denied();
} else {
/* Regular Upload Image */
@@ -371,7 +371,7 @@ class Upload extends Extension
$ok = true;
// Checks if user is admin > check if you want locked.
if ($user->can("edit_image_lock") && !empty($_GET['locked'])) {
if ($user->can(Permissions::EDIT_IMAGE_LOCK) && !empty($_GET['locked'])) {
$locked = bool_escape($_GET['locked']);
}