class PermissionHelper

Class to encapsulate permission checks

Constants

MODE_USER_READ

MODE_USER_WRITE

MODE_GROUP_READ

MODE_GROUP_WRITE

MODE_WORLD_READ

MODE_WORLD_WRITE

Methods

__construct(int $uid = null, int $gid = null)

No description

bool
userIsOwner()

Checks whether user_id on file is the same as executing user

bool
userCanRead()

Checks whether file is readable for user

bool
userCanWrite()

Checks whether file is writable for user

bool
groupIsOwner()

Checks whether group_id on file is the same as executing user

bool
groupCanRead()

Checks whether file is readable for group

bool
groupCanWrite()

Checks whether file is writable for group

bool
worldCanRead()

Checks whether file is readable for world

bool
worldCanWrite()

Checks whether file is writable for world

bool
isReadable()

Checks whether file is readable (by user, group or world)

bool
isWritable()

Checks whether file is writable (by user, group or world)

bool
userIsRoot()

Checks whether userid is 0 - root.

setNode(Node $node)

No description

Details

at line 45
__construct(int $uid = null, int $gid = null)

Parameters

int $uid
int $gid

at line 56
bool userIsOwner()

Checks whether user_id on file is the same as executing user

Return Value

bool

at line 66
bool userCanRead()

Checks whether file is readable for user

Return Value

bool

at line 76
bool userCanWrite()

Checks whether file is writable for user

Return Value

bool

at line 86
bool groupIsOwner()

Checks whether group_id on file is the same as executing user

Return Value

bool

at line 96
bool groupCanRead()

Checks whether file is readable for group

Return Value

bool

at line 106
bool groupCanWrite()

Checks whether file is writable for group

Return Value

bool

at line 116
bool worldCanRead()

Checks whether file is readable for world

Return Value

bool

at line 126
bool worldCanWrite()

Checks whether file is writable for world

Return Value

bool

at line 136
bool isReadable()

Checks whether file is readable (by user, group or world)

Return Value

bool

at line 146
bool isWritable()

Checks whether file is writable (by user, group or world)

Return Value

bool

at line 156
bool userIsRoot()

Checks whether userid is 0 - root.

Return Value

bool

at line 166
PermissionHelper setNode(Node $node)

Parameters

Node $node

Return Value

PermissionHelper