core/src/Security/Voter/ItemVoter.php
/**
     * Validate if a user can add a standard to a document.
     */
Validate if a user can add a standard to a document.
Validate if a user can add a standard to a document .
private function canAddTo(?LsDoc $lsDoc, TokenInterface $token): bool
    {
        if ((null !== $lsDoc) && !$this->deferDecision($token, [FrameworkAccessVoter::EDIT], $lsDoc)) {
            return false;
        }
        if ($this->roleChecker->isEditor($token)) {
            return true;
        }
        return false;
    }
private function canAddTo ( ? LsDoc $ lsDoc , TokenInterface $ token ) : bool { if ( ( null !== $ lsDoc ) && ! $ this -> deferDecision ( $ token , [ FrameworkAccessVoter :: EDIT ] , $ lsDoc ) ) { return false ; } if ( $ this -> roleChecker -> isEditor ( $ token ) ) { return true ; } return false ; }
Validate if a user can add a standard to a document.
Validate if a user can add a standard to a document .
// Check if the user can edit the document // Allow if the user can edit "some" document, i.e. is an editor