WIKINDX API trunk

USERACCESS

Access rights for users performing various functions (view, edit, add, delete, . . .).

Note that access for some operations (e.g., is the user a member of a user group and so allowed to view the comments or musings of a resource?) are not checked here but at the local level because they require SQL conditions.

USERACCESS is loaded at startup. When needed, use something like the following: $ua = new USERACCESS(): if ($us->access(string METHOD, [mixed EXTRA])) {...}

access() calls the required method and passes any optional EXTRA parameter to it.

The following methods are defined: isSuper() isAdmin() isReadOnly() viewAttachment() editAttachment(int RESOURCE_ORIGINATOR_ID) viewMetadata() editMetadata([int METADATA_ORIGINATOR_ID]) editComment(int COMMENT_ORIGINATOR_ID) editUrl(int RESOURCE_ORIGINATOR_ID) editResource(int RESOURCE_ORIGINATOR_ID) viewStatistics() viewUserStatistics() viewNews() editGlobal() editCategory() accessQuarantine([int RESOURCE_ORIGINATOR_ID]) organise(int RESOURCE_ORIGINATOR_ID) organiseList() importBib() pasteBibtex() viewBib(int BIB_ID)

If a method is not found, FALSE is returned. If a parameter is passed to a method and is the incorrect variable type, FALSE is returned. If access is granted, TRUE is returned, otherwise FALSE.

Table of Contents

Methods

__construct()  : mixed
Construct function.
access()  : bool
die()  : void
Die function.

Methods

__construct()

Construct function.

public __construct() : mixed

Get and store basic information about the user

access()

public access(string $method[, mixed $extra = false ]) : bool
Parameters
$method : string
$extra : mixed = false
Return values
bool

die()

Die function.

public die() : void

Used within core code when it looks like the user is explicitly attempting something they should not. For example, copy & paste of a query URL from an enabled user to a non-enabled user in an attempt to gain access to something they should not. If this happens, invite them to logon.


        
On this page

Search results