USERACCESS
in package
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() 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
Properties
Methods
- accessQuarantine() : bool
- editAttachment() : bool
- editCategory() : bool
- editComment() : bool
- editGlobal() : bool
- editMetadata() : bool
- editResource() : bool
- editUrl() : bool
- importBib() : bool
- Import a bibliography
- isAdmin() : bool
- An admin can do almost anything—return the bool status of $this->admin
- isReadOnly() : bool
- Return the bool status of $this->readOnly
- isSuper() : bool
- The super admin can do anything—return the bool status of $this->super
- organise() : bool
- When viewing a resource, can a user organise the resources with categories, keywords, languages, etc.?
- organiseList() : bool
- When viewing a list, can a user organise the resources with categories, keywords, languages, etc.?
- pasteBibtex() : bool
- Import a bibliography by pasting a bibtex file
- viewAttachment() : bool
- viewBib() : bool
- View and browse a single user or group or public bibliography
- viewMetadata() : bool
- viewStatistics() : bool
- viewUserStatistics() : bool
Properties
$admin
private
mixed
$admin
= \FALSE
$readOnly
private
mixed
$readOnly
= \TRUE
$super
private
mixed
$super
= \FALSE
$userId
private
mixed
$userId
Methods
accessQuarantine()
private
accessQuarantine([int $id = 0 ]) : bool
Parameters
- $id : int = 0
Return values
booleditAttachment()
private
editAttachment(int $id) : bool
Parameters
- $id : int
Return values
booleditCategory()
private
editCategory() : bool
Return values
booleditComment()
private
editComment([mixed $id = FALSE ]) : bool
Parameters
- $id : mixed = FALSE
Return values
booleditGlobal()
private
editGlobal() : bool
Return values
booleditMetadata()
private
editMetadata([mixed $id = FALSE ]) : bool
Parameters
- $id : mixed = FALSE
Return values
booleditResource()
private
editResource(int $id) : bool
Parameters
- $id : int
Return values
booleditUrl()
private
editUrl(int $id) : bool
Parameters
- $id : int
Return values
boolimportBib()
Import a bibliography
private
importBib() : bool
Return values
boolisAdmin()
An admin can do almost anything—return the bool status of $this->admin
private
isAdmin() : bool
Return values
boolisReadOnly()
Return the bool status of $this->readOnly
private
isReadOnly() : bool
Return values
boolisSuper()
The super admin can do anything—return the bool status of $this->super
private
isSuper() : bool
Return values
boolorganise()
When viewing a resource, can a user organise the resources with categories, keywords, languages, etc.?
private
organise([int $id = 0 ]) : bool
Be careful when comparing $id with user ID. A readOnly user has a FALSE id, not 0!
Parameters
- $id : int = 0
-
RESOURCE_ORIGINATOR_ID Default is 0
Return values
boolorganiseList()
When viewing a list, can a user organise the resources with categories, keywords, languages, etc.?
private
organiseList() : bool
Return values
boolpasteBibtex()
Import a bibliography by pasting a bibtex file
private
pasteBibtex() : bool
Return values
boolviewAttachment()
private
viewAttachment() : bool
Return values
boolviewBib()
View and browse a single user or group or public bibliography
private
viewBib(int $id) : bool
Parameters
- $id : int
Return values
boolviewMetadata()
private
viewMetadata() : bool
Return values
boolviewStatistics()
private
viewStatistics() : bool
Return values
boolviewUserStatistics()
private
viewUserStatistics() : bool