Re-sync administrator access control.

@return void
770934
public function handle()
    {
        $admin = $this->app->make('orchestra.role')->admin();

        $this->acl->allow($admin->name, ['Manage Users', 'Manage Orchestra', 'Manage Roles', 'Manage Acl']);
    }
1021346
public function handleClearCacheACL(): void
	{
		if ($this->isAjax()) {
			$this->authorizatorFactory->cleanCache();
			$this->flashNotifier->success('cms.permissions.aclCacheCleared');
		} else {
			$this->terminate();
		}
	}
639114
public function update(Permission $permission)
    {
        $this->validate($this->request, [
            'name'     => 'required',
            'resource' => 'required|alpha_num',
            'slug'     => 'required|unique:permissions,slug,' . $permission->id,
        ]);

        $permission->name     = $this->request->get('name');
        $permission->resource = $this->request->get('resource');
        if (! $permission->system) {
            $permission->slug = $this->request->get('slug');
        }
        $permission->save();

        $permission->syncRoles($this->request->get('roles', []));

        return redirect()->route('administrator.permissions.index');
    }
503047
private function refreshAccessToken() {
        // Setup the params
        $params = [
            'client_id'     => $this->clientID,
            'client_secret' => $this->secret,
            'grant_type'    => 'refresh_token',
            'refresh_token' => $this->refreshToken
        ];

        // Parse the cURL result
        $this->parseAccessToken(CURL::post($this->url, $params));
    }
1067576
public function handleMaintenanceMode()
    {
        // Authorize logged in admins on the fly
        if ($this->doesCurrentUserHaveAccess())
        {
            return true;
        }

        if (Craft::$app->request->isSiteRequest && $this->settings->maintenanceModeEnabled)
        {
            $requestingIp   = $this->getRequestingIp();
            $authorizedIps  = $this->settings->maintenanceModeAuthorizedIps;
            $maintenanceUrl = $this->settings->maintenanceModePageUrl;

            if ($maintenanceUrl == Craft::$app->request->getUrl())
            {
                return true;
            }

            if (empty($authorizedIps))
            {
                $this->forceRedirect($maintenanceUrl);
            }

            if (is_array($authorizedIps) && count($authorizedIps))
            {
                if (in_array($requestingIp, $authorizedIps))
                {
                    return true;
                }

                foreach ($authorizedIps as $authorizedIp)
                {
                    $authorizedIp = str_replace('*', '', $authorizedIp);

                    if (stripos($requestingIp, $authorizedIp) === 0)
                    {
                        return true;
                    }
                }

                $this->forceRedirect($maintenanceUrl);
            }
        }
    }
297180
protected function restorePreviousLockFile()
    {
        $config = $this->composer->getConfig();
        list($preferSource, $preferDist) = ConsoleUtil::getPreferredInstallOptions($config, $this->input);
        $optimize = $this->input->getOption('optimize-autoloader') || $config->get('optimize-autoloader');
        $authoritative = $this->input->getOption('classmap-authoritative') || $config->get('classmap-authoritative');
        $apcu = $this->input->getOption('apcu-autoloader') || $config->get('apcu-autoloader');

        $this->getInstaller()
            ->setVerbose($this->input->getOption('verbose'))
            ->setPreferSource($preferSource)
            ->setPreferDist($preferDist)
            ->setDevMode(!$this->input->getOption('no-dev'))
            ->setDumpAutoloader(!$this->input->getOption('no-autoloader'))
            ->setRunScripts(false)
            ->setSkipSuggest(true)
            ->setOptimizeAutoloader($optimize)
            ->setClassMapAuthoritative($authoritative)
            ->setApcuAutoloader($apcu)
            ->setIgnorePlatformRequirements($this->input->getOption('ignore-platform-reqs'))
            ->run()
        ;
    }
302609
protected function updateInheritancePermissions()
    {
        foreach ($this->inheritancePermissions() as $role => $items) {
            foreach ($items as $item) {
                $this->authManager
                    ->addChild(RbacFactory::Role($role), RbacFactory::Permission($item));

                echo sprintf('    > role `%s` inherited permission `%s`.', $role, $item) . PHP_EOL;
            }
        }
    }
745866
public function reload(): WebAcl {
        $fedora         = $this->res->getFedora();
        $resUri         = $this->res->getUri(true);
        $aclUri         = $this->res->getAclUrl();
        $this->resRules = [];
        $this->extRules = [];

        if ($aclUri) {
            $query   = new SimpleQuery(self::QUERY, [$resUri, $aclUri]);
            $results = $fedora->runQuery($query);
            $rules   = self::initRules($results, $fedora, $aclUri);
            foreach ($rules as $r) {
                if ($r->hasResource($resUri)) {
                    $this->resRules[] = $r;
                } else {
                    $this->extRules[] = $r;
                }
            }
        }
        return $this;
    }
309015
public function refreshAllowedOrganizations()
    {
        // Privilege overrules organizational settings
        if ($this->hasPrivilege('pr.organization-switch')) {
            $orgs = $this->util->getDbLookup()->getOrganizations();
        } else {
            $org = $this->getBaseOrganization();

            $orgs = array($org->getId() => $org->getName()) +
                    $org->getAllowedOrganizations();
        }
        // \MUtil_Echo::track($orgs);

        $this->_setVar('__allowedOrgs', $orgs);

        // Clean this cache
        $this->_unsetVar('__allowedRespOrgs');

        return $this;
    }
850134
def reset_access_controls!
      update!(edit_users: permission_template_edit_users,
              edit_groups: permission_template_edit_groups,
              read_users: permission_template_read_users,
              read_groups: (permission_template_read_groups + visibility_group).uniq)
    end
786807
public function actionChangeSettings()
    {
        $params = Yii::$app->request->bodyParams;
        
        foreach ($params as $param => $value) {
            Yii::$app->adminuser->identity->setting->set($param, $value);
        }
        
        return true;
    }
727821
public function reset()
    {
        $keep = array(
            Horde_Imap_Client::STATUS_SYNCFLAGUIDS,
            Horde_Imap_Client::STATUS_SYNCMODSEQ,
            Horde_Imap_Client::STATUS_SYNCVANISHED
        );

        foreach (array_diff(array_keys($this->_status), $keep) as $val) {
            unset($this->_status[$val]);
        }

        $this->map = new Horde_Imap_Client_Ids_Map();
        $this->open = $this->sync = false;
    }
989328
public static function release()
	{
		if ( is_null( self::$authFileP ) ) return;
		$a = @flock( self::$authFileP , LOCK_UN );
		@fclose( self::$authFileP );
		self::$authFileP       = null;
		self::$currentlylocked = false;
	}
569377
public function resetAdminRights($users)
    {
        foreach ($this->makeTraversable($users) as $user) {
            $this->doResetAdminRights($user);
        }
    }
612011
public function refresh() {
    $grant = new ClientCredentialsGrantRequest($this->clientId, $this->clientSecret, $this->scopes);
    $tokens = $grant->getTokens();

    $this->accessToken = $tokens->{"access_token"};
    $this->expiresAt = Util::calculateExpiryTime($tokens->{"expires_in"});
  }
308956
protected function controlCommonAccess()
    {
        if (!$this->isInstall()) {

            if (!empty($this->uid)) {
                $this->controlAccessCredentials();
            }

            $this->controlCsrf();
            $this->controlAccessUpload();
            $this->controlAccessRestrictedArea();
            $this->controlAccessAdmin();
            $this->controlAccessAccount();
        }
    }
8294
protected function restoreAccessToken() {
		if (!$this->authenticated) {
			if ($this->hasState('auth_token') && $this->getState('expires', 0) > time()) {
				$this->access_token = $this->getState('auth_token');
				$this->authenticated = true;
			}
			else {
				$this->access_token = null;
				$this->authenticated = false;
			}
		}

		return $this->authenticated;
	}