private function GrantByProperties($guestsOnly, $publish, Date $from = null, Date $to = null, array $groups = array())
    {
        if (!PublishDateUtil::IsPublishedNow($publish, $from, $to))
        {
            return GrantResult::NoAccess();
        }
        if ($this->GetMember() && $guestsOnly)
        {
            return GrantResult::NoAccess();
        }
        if (count($groups) == 0)
        {
            return GrantResult::Allowed();
        }
        if (!$this->GetMember())
        {
            return GrantResult::LoginRequired();
        }
        $groupIDs = Membergroup::GetKeyList($groups);
        $memberGroupIDs = Membergroup::GetKeyList($this->Groups());
        return count(array_intersect($groupIDs, $memberGroupIDs)) ? GrantResult::Allowed() :
            GrantResult::NoAccess();
    }
private function GrantByProperties($guestsOnly, $publish, Date $from = null, Date $to = null, array $groups = array())
    {
        if (!PublishDateUtil::IsPublishedNow($publish, $from, $to))
        {
            return GrantResult::NoAccess();
        }
        if ($this->GetMember() && $guestsOnly)
        {
            return GrantResult::NoAccess();
        }
        if (count($groups) == 0)
        {
            return GrantResult::Allowed();
        }
        if (!$this->GetMember())
        {
            return GrantResult::LoginRequired();
        }
        $groupIDs = Membergroup::GetKeyList($groups);
        $memberGroupIDs = Membergroup::GetKeyList($this->Groups());
        return count(array_intersect($groupIDs, $memberGroupIDs)) ? GrantResult::Allowed() :
            GrantResult::NoAccess();
    }
private function GrantByProperties ( $ guestsOnly , $ publish , Date $ from = null , Date $ to = null , array $ groups = array ( ) ) { if ( ! PublishDateUtil :: IsPublishedNow ( $ publish , $ from , $ to ) ) { return GrantResult :: NoAccess ( ) ; } if ( $ this -> GetMember ( ) && $ guestsOnly ) { return GrantResult :: NoAccess ( ) ; } if ( count ( $ groups ) == 0 ) { return GrantResult :: Allowed ( ) ; } if ( ! $ this -> GetMember ( ) ) { return GrantResult :: LoginRequired ( ) ; } $ groupIDs = Membergroup :: GetKeyList ( $ groups ) ; $ memberGroupIDs = Membergroup :: GetKeyList ( $ this -> Groups ( ) ) ; return count ( array_intersect ( $ groupIDs , $ memberGroupIDs ) ) ? GrantResult :: Allowed ( ) : GrantResult :: NoAccess ( ) ; }
Checks access to an item by its properties and assigned groups
@param boolean $guestsOnly True if guests only see the item
@param boolean $publish True if item is generally published
@param Date $from The start date of publishing
@param Date $to The end date of publishing
@param Membergroup[] $groups Groups assigned to the item
@return GrantResult
Checks access to an item by its properties and assigned groups