Remove `UserGroupOptionForm::verifyPermissions()` (#4312)
authorMatthias Schmidt <gravatronics@live.com>
Tue, 22 Jun 2021 14:45:24 +0000 (16:45 +0200)
committerGitHub <noreply@github.com>
Tue, 22 Jun 2021 14:45:24 +0000 (16:45 +0200)
This method has been deprecated for many years since c1b907f345397a5604f8ceca8af257d61938639a.

wcfsetup/install/files/lib/acp/form/UserGroupOptionForm.class.php

index 6a11d77a98009fe3a89aa81fae4685f6fd6a7597..79e31ca033a8ab35199a2e3b93fcc2cba6ddd7f1 100644 (file)
@@ -2,7 +2,6 @@
 
 namespace wcf\acp\form;
 
-use wcf\data\DatabaseObject;
 use wcf\data\user\group\option\category\UserGroupOptionCategory;
 use wcf\data\user\group\option\category\UserGroupOptionCategoryList;
 use wcf\data\user\group\option\UserGroupOption;
@@ -312,49 +311,4 @@ class UserGroupOptionForm extends AbstractForm
             'ownerGroupPermissions' => $ownerGroupPermissions,
         ]);
     }
-
-    /**
-     * Validates object options and permissions.
-     *
-     * @param DatabaseObject $object
-     * @return  boolean
-     *
-     * @deprecated  3.0
-     */
-    protected function verifyPermissions(DatabaseObject $object)
-    {
-        // check the options of this item
-        $hasEnabledOption = true;
-        if ($object->options) {
-            $hasEnabledOption = false;
-            $options = \explode(',', \strtoupper($object->options));
-            foreach ($options as $option) {
-                if (\defined($option) && \constant($option)) {
-                    $hasEnabledOption = true;
-                    break;
-                }
-            }
-        }
-        if (!$hasEnabledOption) {
-            return false;
-        }
-
-        // check the permission of this item for the active user
-        $hasPermission = true;
-        if ($object->permissions) {
-            $hasPermission = false;
-            $permissions = \explode(',', $object->permissions);
-            foreach ($permissions as $permission) {
-                if (WCF::getSession()->getPermission($permission)) {
-                    $hasPermission = true;
-                    break;
-                }
-            }
-        }
-        if (!$hasPermission) {
-            return false;
-        }
-
-        return true;
-    }
 }