Browse Source

after doing a database restore, the permission may not yet exist (#6930)

frytimo 1 year ago
parent
commit
b316791101
1 changed files with 1 additions and 1 deletions
  1. 1 1
      resources/classes/permissions.php

+ 1 - 1
resources/classes/permissions.php

@@ -46,7 +46,7 @@ if (!class_exists('permissions')) {
 		 * @var string $permission
 		 * @var string $permission
 		 */
 		 */
 		public function delete($permission, $type) {
 		public function delete($permission, $type) {
-			if ($this->exists($permission)) {
+			if ($this->exists($permission) && !empty($_SESSION["permissions"][$permission])) {
 				if ($type === "temp") {
 				if ($type === "temp") {
 					if ($_SESSION["permissions"][$permission] === "temp") {
 					if ($_SESSION["permissions"][$permission] === "temp") {
 						unset($_SESSION["permissions"][$permission]);
 						unset($_SESSION["permissions"][$permission]);