Documentation

Horde_Share_Object
in package
implements Serializable

Abstract class for storing Share information.

This class should be extended for the more specific drivers.

Tags
author

Mike Cochrane mike@graftonhall.co.nz

author

Jan Schneider jan@horde.org

author

Gunnar Wrobel wrobel@pardus.de

Interfaces, Classes, Traits and Enums

Serializable

Table of Contents

$_shareCallback  : callable
A function to be called when a Horde_Share object is needed and not available.
$_shareOb  : Horde_Share
The Horde_Share object which this share is associated with.
addCreatorPermission()  : mixed
Gives creators a certain privilege for this share.
addDefaultPermission()  : mixed
Gives all authenticated users a certain privilege for this share.
addGroupPermission()  : mixed
Gives a group certain privileges for this share.
addGuestPermission()  : mixed
Gives guests a certain privilege for this share.
addUserPermission()  : mixed
Gives a user a certain privilege for this share.
get()  : mixed
Returns an attribute value from this object.
getId()  : string
Returns the ID of this share.
getName()  : string
Returns the name of this share.
getPermission()  : Horde_Perms_Permission
Returns the permission of this share.
getShareOb()  : Horde_Share
Obtain this object's share driver.
hasPermission()  : bool
Checks to see if a user has a given permission.
listGroups()  : array<string|int, mixed>
Returns an array containing all the groupids of the groups with access to this share.
listUsers()  : array<string|int, mixed>
Returns an array containing all the userids of the users with access to this share.
removeCreatorPermission()  : mixed
Removes a certain privilege for creators from this share.
removeDefaultPermission()  : mixed
Removes a certain privilege for all authenticated users from this share.
removeGroup()  : mixed
Removes a group from this share.
removeGroupPermission()  : mixed
Removes a certain privilege from a group.
removeGuestPermission()  : mixed
Removes a certain privilege for guests from this share.
removeUser()  : mixed
Removes a user from this share.
removeUserPermission()  : mixed
Removes a certain privilege for a user from this share.
save()  : bool
Saves the current attribute values.
set()  : bool
Sets an attribute value in this object.
setPermission()  : mixed
Sets the permission of this share.
setShareOb()  : mixed
Associates a Share object with this share, or provides a callback that knows how to provide it.
toHash()  : array<string|int, mixed>
Exports the share object as a PHP hash.
_getAttributes()  : array<string|int, mixed>
Returns the share attributes.
_save()  : mixed
Saves the current attribute values.

Properties

$_shareCallback

A function to be called when a Horde_Share object is needed and not available.

protected callable $_shareCallback

$_shareOb

The Horde_Share object which this share is associated with.

protected Horde_Share $_shareOb

If this is empty, the $_shareCallback is called to obtain it.

Methods

addCreatorPermission()

Gives creators a certain privilege for this share.

public addCreatorPermission(int $permission) : mixed
Parameters
$permission : int

A Horde_Perms::* constant.

Return values
mixed

addDefaultPermission()

Gives all authenticated users a certain privilege for this share.

public addDefaultPermission(int $permission) : mixed
Parameters
$permission : int

A Horde_Perms::* constant.

Return values
mixed

addGroupPermission()

Gives a group certain privileges for this share.

public addGroupPermission(string $group, int $permission) : mixed
Parameters
$group : string

The group to add permissions for.

$permission : int

A Horde_Perms::* constant.

Return values
mixed

addGuestPermission()

Gives guests a certain privilege for this share.

public addGuestPermission(int $permission) : mixed
Parameters
$permission : int

A Horde_Perms::* constant.

Return values
mixed

addUserPermission()

Gives a user a certain privilege for this share.

public addUserPermission(string $userid, int $permission) : mixed
Parameters
$userid : string

The userid of the user.

$permission : int

A Horde_Perms::* constant.

Return values
mixed

get()

Returns an attribute value from this object.

public abstract get(string $attribute) : mixed
Parameters
$attribute : string

The attribute to return.

Return values
mixed

The value for $attribute.

getId()

Returns the ID of this share.

public abstract getId() : string
Return values
string

The share's ID.

getName()

Returns the name of this share.

public abstract getName() : string
Return values
string

The share's name.

getPermission()

Returns the permission of this share.

public abstract getPermission() : Horde_Perms_Permission
Return values
Horde_Perms_Permission

Permission object that represents the permissions on this share.

getShareOb()

Obtain this object's share driver.

public getShareOb() : Horde_Share
Return values
Horde_Share

The share driver.

hasPermission()

Checks to see if a user has a given permission.

public abstract hasPermission(string $userid, int $permission[, string $creator = null ]) : bool
Parameters
$userid : string

The userid of the user.

$permission : int

A Horde_Perms::* constant to test for.

$creator : string = null

The creator of the event.

Return values
bool

Whether or not $userid has $permission.

listGroups()

Returns an array containing all the groupids of the groups with access to this share.

public listGroups([int $perm_level = null ]) : array<string|int, mixed>
Parameters
$perm_level : int = null

List only users with this permission level. Defaults to all users.

Return values
array<string|int, mixed>

The IDs of the groups with access to this share.

listUsers()

Returns an array containing all the userids of the users with access to this share.

public listUsers([int $perm_level = null ]) : array<string|int, mixed>
Parameters
$perm_level : int = null

List only users with this permission level. Defaults to all users.

Return values
array<string|int, mixed>

The users with access to this share.

removeCreatorPermission()

Removes a certain privilege for creators from this share.

public removeCreatorPermission(int $permission) : mixed
Parameters
$permission : int

A Horde_Perms::* constant.

Return values
mixed

removeDefaultPermission()

Removes a certain privilege for all authenticated users from this share.

public removeDefaultPermission(int $permission) : mixed
Parameters
$permission : int

A Horde_Perms::* constant.

Return values
mixed

removeGroup()

Removes a group from this share.

public removeGroup(int $groupId) : mixed
Parameters
$groupId : int

The group to remove.

Return values
mixed

removeGroupPermission()

Removes a certain privilege from a group.

public removeGroupPermission(string $group, constant $permission) : mixed
Parameters
$group : string

The group to remove permissions from.

$permission : constant

A Horde_Perms::* constant.

Return values
mixed

removeGuestPermission()

Removes a certain privilege for guests from this share.

public removeGuestPermission(int $permission) : mixed
Parameters
$permission : int

A Horde_Perms::* constant.

Return values
mixed

removeUser()

Removes a user from this share.

public removeUser(string $userid) : mixed
Parameters
$userid : string

The userid of the user to remove.

Return values
mixed

removeUserPermission()

Removes a certain privilege for a user from this share.

public removeUserPermission(string $userid, int $permission) : mixed
Parameters
$userid : string

The userid of the user.

$permission : int

A Horde_Perms::* constant.

Return values
mixed

save()

Saves the current attribute values.

public save() : bool
Tags
throws
Horde_Exception
Return values
bool

set()

Sets an attribute value in this object.

public abstract set(string $attribute, mixed $value[, bool $update = false ]) : bool
Parameters
$attribute : string

The attribute to set.

$value : mixed

The value for $attribute.

$update : bool = false

Immediately update only this change.

Return values
bool

setPermission()

Sets the permission of this share.

public abstract setPermission(Horde_Perms_Permission $perm[, bool $update = true ]) : mixed
Parameters
$perm : Horde_Perms_Permission

Permission object.

$update : bool = true

Should the share be saved after this operation?

Return values
mixed

setShareOb()

Associates a Share object with this share, or provides a callback that knows how to provide it.

public setShareOb(mixed $shareOb) : mixed
Parameters
$shareOb : mixed
Return values
mixed

toHash()

Exports the share object as a PHP hash.

public toHash() : array<string|int, mixed>
Tags
since

Horde_Shares 2.2.0

Return values
array<string|int, mixed>

Hash representation of this share.

_getAttributes()

Returns the share attributes.

protected abstract _getAttributes() : array<string|int, mixed>
Return values
array<string|int, mixed>

All share attributes as a hash.

_save()

Saves the current attribute values.

protected abstract _save() : mixed
Return values
mixed

Search results