public function getPermissionsByPage($page, $sid)
    {
        $objectIdentity = $this->getClassScopeObjectIdentity($page);

        try{

            $ace = $this->getObjectAce($objectIdentity, $sid);
        }
        catch (\Exception $e){

            if (null !== $page->getParent()) {

                return $this->getPermissionsByPage($page->getParent(), $sid);
            }
            elseif ($page->isRoot()){

                try{
                    $ace = $this->getClassAce($this->getClassScopeObjectIdentity(ClassUtils::getRealClass($page)), $sid);
                }
                catch (\Exception $e){
                    return [];
                }
            }
            else{
                return [];
            }
        }

        return $this->getAccessGranted($ace);
    }
public function getPermissionsByPage($page, $sid)
    {
        $objectIdentity = $this->getClassScopeObjectIdentity($page);

        try{

            $ace = $this->getObjectAce($objectIdentity, $sid);
        }
        catch (\Exception $e){

            if (null !== $page->getParent()) {

                return $this->getPermissionsByPage($page->getParent(), $sid);
            }
            elseif ($page->isRoot()){

                try{
                    $ace = $this->getClassAce($this->getClassScopeObjectIdentity(ClassUtils::getRealClass($page)), $sid);
                }
                catch (\Exception $e){
                    return [];
                }
            }
            else{
                return [];
            }
        }

        return $this->getAccessGranted($ace);
    }
public function getPermissionsByPage ( $ page , $ sid ) { $ objectIdentity = $ this -> getClassScopeObjectIdentity ( $ page ) ; try { $ ace = $ this -> getObjectAce ( $ objectIdentity , $ sid ) ; } catch ( \ Exception $ e ) { if ( null !== $ page -> getParent ( ) ) { return $ this -> getPermissionsByPage ( $ page -> getParent ( ) , $ sid ) ; } elseif ( $ page -> isRoot ( ) ) { try { $ ace = $ this -> getClassAce ( $ this -> getClassScopeObjectIdentity ( ClassUtils :: getRealClass ( $ page ) ) , $ sid ) ; } catch ( \ Exception $ e ) { return [ ] ; } } else { return [ ] ; } } return $ this -> getAccessGranted ( $ ace ) ; }
Get permissions by page

@param $page Page
@param $sid
@return array
Get permissions by page