public function hasGroupPermission(Group $group)
    {
        $definitions = (new Query())->select("nav_id")->from("cms_nav_permission")->where(['group_id' => $group->id])->all();
        
        // the group has no permission defined, this means he can access ALL cms pages
        if (count($definitions) == 0) {
            return true;
        }
        
        foreach ($definitions as $permission) {
            if ($this->id == $permission['nav_id']) {
                return true;
            }
        }
        
        return false;
    }
public function hasGroupPermission(Group $group)
    {
        $definitions = (new Query())->select("nav_id")->from("cms_nav_permission")->where(['group_id' => $group->id])->all();
        
        // the group has no permission defined, this means he can access ALL cms pages
        if (count($definitions) == 0) {
            return true;
        }
        
        foreach ($definitions as $permission) {
            if ($this->id == $permission['nav_id']) {
                return true;
            }
        }
        
        return false;
    }
public function hasGroupPermission ( Group $ group ) { $ definitions = ( new Query ( ) ) -> select ( "nav_id" ) -> from ( "cms_nav_permission" ) -> where ( [ 'group_id' => $ group -> id ] ) -> all ( ) ; // the group has no permission defined, this means he can access ALL cms pages if ( count ( $ definitions ) == 0 ) { return true ; } foreach ( $ definitions as $ permission ) { if ( $ this -> id == $ permission [ 'nav_id' ] ) { return true ; } } return false ; }
See if a given group has perrmission for the current nav model.

@param Group $group
@return boolean
See if a given group has perrmission for the current nav model .