public function authorizeUserAction($ability, $arguments = [])
    {
        // Ability could be discarded for child controller parent resource checks
        if (is_null($ability)) {
            return true;
        }

        if (! $this->userCan($ability, $arguments)) {
            throw new AccessDeniedHttpException('Unauthorized action');
        }
    }
public function authorizeUserAction($ability, $arguments = [])
    {
        // Ability could be discarded for child controller parent resource checks
        if (is_null($ability)) {
            return true;
        }

        if (! $this->userCan($ability, $arguments)) {
            throw new AccessDeniedHttpException('Unauthorized action');
        }
    }
public function authorizeUserAction ( $ ability , $ arguments = [ ] ) { // Ability could be discarded for child controller parent resource checks if ( is_null ( $ ability ) ) { return true ; } if ( ! $ this -> userCan ( $ ability , $ arguments ) ) { throw new AccessDeniedHttpException ( 'Unauthorized action' ) ; } }
Shorthand function which checks the currently logged in user against an action for the controller's model,
and throws a 403 if unauthorized

Only checks if a policy exists for that model.

@param string $ability
@param array|mixed $arguments
@throws AccessDeniedHttpException
Shorthand function which checks the currently logged in user against an action for the controller s model and throws a 403 if unauthorized