public function assert(Rbac $rbac) { if (!$this->user || !$this->visitor) { return false; } $friendship = \User\Model\Friend::checkFriendship($this->user['id'], $this->visitor['id']); return $friendship && $friendship['relationshipStatus'] == 'blocked' ? false : true; }
public function assert(Rbac $rbac) { if (!$this->user || !$this->visitor) { return false; } //My friend should including me if ($this->user['id'] == $this->visitor['id']) { return true; } $friendship = \User\Model\Friend::checkFriendship($this->user['id'], $this->visitor['id']); return $friendship && $friendship['relationshipStatus'] == 'approved' ? true : false; }