RoleController::removeRankPermissions PHP Method

removeRankPermissions() protected method

protected removeRankPermissions ( )
    protected function removeRankPermissions()
    {
        if (Gdn::session()->checkPermission('Garden.Settings.Manage')) {
            return;
        }
        // Remove ranking permissions.
        $Permissions = $this->Form->getFormValue('Permission');
        foreach ($this->RoleModel->RankPermissions as $Permission) {
            if (!Gdn::session()->checkPermission($Permission) && in_array($Permission, $Permissions)) {
                $Index = array_search($Permission, $Permissions);
                unset($Permissions[$Index]);
            }
        }
        $this->Form->setFormValue('Permission', $Permissions);
    }