isAuthorized

@static
@access public
@return void
777065
public static function isAuthorized()
    {
        $headers = apache_request_headers();
        if (isset($_SESSION['uid'])) {
            return true;
        }
        if(!isset($headers['N5-Api-Sig']))
            return FALSE;
        $salt = "N@t1v3";
        $request_sig = $headers['N5-Api-Sig'];
        $string = $headers['N5-Api-Key'].$salt;
        if(hash('sha256', $string) == $request_sig)
            return TRUE;
        return FALSE;	
    }
844463
public function canOauthorize()
    {
        $api = $this->getAPI();
        
        if ($api && $this->actor) {
            return $api->canAddService($this->actor);
        }

        return !is_null($api);
    }
465000
public function isAuthorized($user = null) {
        parent::isAuthorized($user);

        if (!$this->Acl->check(array(USER_MODEL => $user), $this->Model->qualifiedName, 'read')) {
            throw new UnauthorizedException(__d('admin', 'Insufficient Access Permissions'));
        }

        return true;
    }
244378
public function isApplicationAuthorized(){

        $application = [];

        if ($this->authorizationChecker->isGranted('IS_AUTHENTICATED_FULLY')) {

            $autorizzazioni = $this->tokenStorage->getToken()->getUser()->getIdAutorizzazione();

            foreach($autorizzazioni as $autorizzazione){
                $application[] = $autorizzazione->getIdApplicazione()->getIdApplicazione();
            }

        }


        return in_array($this->application_id, $application);
    }
369412
protected function shouldSkipAuth()
    {
        $config = b8\Config::getInstance();
        $state = (bool)$config->get('phpci.authentication_settings.state', false);
        $userId    = $config->get('phpci.authentication_settings.user_id', 0);

        if (false !== $state && 0 != (int)$userId) {
            $user = b8\Store\Factory::getStore('User')
                ->getByPrimaryKey($userId);

            if ($user) {
                $_SESSION['phpci_user'] = $user;
                return true;
            }
        }

        return false;
    }
530570
private boolean isAuthenticated() {
        Authentication existingAuth = SecurityContextHolder.getContext().getAuthentication();
        return !(!(existingAuth != null && existingAuth.isAuthenticated()) || existingAuth instanceof SSOAuthentication);
    }
1036469
public function isAccessible()
    {
        $loop = $this;
        $access = true;

        while ($loop->getReply() != null) {
            $loop = $loop->getReply();

            if ($loop->getSpam() == 1 || $loop->getActive() == 0 || $loop->isEmailValid() == 0) {
                $access = false;
            }
        }

        return $access;
    }
344282
public function is_valid()
    {
        $isauthority = $this->iuserinfo !== null || $this->ihost !== null || $this->port !== null;
        if ($this->ipath !== '' &&
            (
                $isauthority && (
                    $this->ipath[0] !== '/' ||
                    substr($this->ipath, 0, 2) === '//'
                ) ||
                (
                    $this->scheme === null &&
                    !$isauthority &&
                    strpos($this->ipath, ':') !== false &&
                    (strpos($this->ipath, '/') === false ? true : strpos($this->ipath, ':') < strpos($this->ipath, '/'))
                )
            )
        )
        {
            return false;
        }

        return true;
    }
1268196
private function _setSecure() {
        if (Config::config()['user']['secure']['get'] && isset($_GET)) {
            $_GET = $this->_setSecureArray($_GET);
        }

        if (Config::config()['user']['secure']['post'] && isset($_POST)) {
            $_POST = $this->_setSecureArray($_POST);
        }
    }
294641
public function checkIsAdmin()
    {
        $this->checkIsLogin();

        $user = new User($this->di->get("db"));
        $user = $user->getUser($this->di->get("session")->get("user"));

        if ($user->authority != "admin") {
            $views = [
                ["comment/admin/fail", [], "main"]
            ];
            $this->di->get("pageRenderComment")->renderPage([
                "views" => $views,
                "title" => "Not authorized"
            ]);
        }
    }
185009
public function isAuthorized($user = null) {
        parent::isAuthorized($user);

        if (empty($this->params['model'])) {
            throw new ForbiddenException(__d('admin', 'Invalid Model'));
        }

        list($plugin, $model, $class) = Admin::parseName($this->params['model']);

        // Don't allow certain models
        if (in_array($class, Configure::read('Admin.ignoreModels'))) {
            throw new ForbiddenException(__d('admin', 'Restricted Model'));
        }

        $action = $this->action;

        // Allow non-crud actions
        if (in_array($action, array('type_ahead', 'proxy', 'process_behavior', 'process_model'))) {
            return true;

        // Index counts as a read
        } else if ($action === 'index') {
            $action = 'read';
        }

        if ($this->Acl->check(array(USER_MODEL => $user), $class, $action)) {
            return true;
        }

        throw new UnauthorizedException(__d('admin', 'Insufficient Access Permissions'));
    }
1310444
protected function isAdmin() {
        $member = $this->currentUser();
        return $member && \Injector::inst()->get('PermissionChecks')->isAdmin($member);
    }
681703
public function init()
	{
		parent::init();
		if($this->authFile===null)
			$this->authFile=Yii::getPathOfAlias('application.data.auth').'.php';
		$this->load();
	}
895759
public function isAuthGroupConfigured() {
		$markerFile = $this->getPathMarkerFile();
		if ($this->_checkMarkerFile($markerFile)) {
			return true;
		}

		$authGroupsList = $this->getAuthGroupsList();
		if (empty($authGroupsList)) {
			return false;
		}

		foreach ($authGroupsList as $fieldName) {
			if (!$this->getConfig($fieldName)) {
				return false;
			}
		}

		return $this->_createMarkerFile($markerFile);
	}
629119
public function isAuthorized($user)
    {
        $this->Authorizer->action(['*'], function ($auth, $user) {
            $auth->allowRole([1]);
        });

        return $this->Authorizer->authorize();
    }
472272
public function setupAuthentication() {
		if (!in_array('Auth', $this->components()->loaded())) {
			$this->components()->load('Auth');
		}

		$this->components()->Auth->setConfig('authenticate', [
			'Form' => [
				'userModel' => 'Users',
				'fields' => [
					'username' => 'email',
					'password' => 'password'
				],
				'scope' => [
					'Users.email_verified' => 1
				]
			]
		]);
	}
246879
function isAuthorized(acl, user) {
    acl = u.str(acl).toUpperCase();
    user = u.str(user).toUpperCase();
    if (user && user === acl) return true;
    if (!aclRe[acl]) {
      aclRe[acl] = reAccess(sessionOpts.acl[acl] || process.env['ACL_' + acl]);
    }
    return aclRe[acl].test(user) || aclRe.ADMIN.test(user);
  }