You are here

public function vfsStreamAbstractContent::isReadable in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamAbstractContent.php \org\bovigo\vfs\vfsStreamAbstractContent::isReadable()

checks whether content is readable

Parameters

int $user id of user to check for:

int $group id of group to check for:

Return value

bool

Overrides vfsStreamContent::isReadable

File

vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamAbstractContent.php, line 260

Class

vfsStreamAbstractContent
Base stream contents container.

Namespace

org\bovigo\vfs

Code

public function isReadable($user, $group) {
  if ($this->user === $user) {
    $check = 0400;
  }
  elseif ($this->group === $group) {
    $check = 040;
  }
  else {
    $check = 04;
  }
  return (bool) ($this->permissions & $check);
}