Menu

## SeedDMS_Core_Role
in package

inc.ClassUser.php : 26

Class to represent a role in the document management system

##### Tags

category

  DMS

author

  Uwe Steinmann uwe@steinmann.cx

copyright

  Copyright (C) 2016 Uwe Steinmann

version

  Release: @package_version@

### Table of Contents

#### Constants

role_admin = '1'
role_guest = '2'
role_user = '0'

#### Properties

$_dms : object
$_id : int
$_name : string
$_noaccess : array<string|int, mixed>
$_role : string

#### Methods

__construct() : mixed
getAllInstances() : mixed
getID() : mixed
getInstance() : object
  Create an instance of a role object
getName() : mixed
getNoAccess() : mixed
getRole() : mixed
getUsers() : mixed
isAdmin() : mixed
isGuest() : mixed
isUsed() : mixed
remove() : bool
  Delete role
setDMS() : mixed
setName() : mixed
setNoAccess() : mixed
setRole() : mixed

### Constants

#### role_admin

inc.ClassUser.php : 64
`public mixed role_admin = '1'`

#### role_guest

inc.ClassUser.php : 65
`public mixed role_guest = '2'`

#### role_user

inc.ClassUser.php : 63
`public mixed role_user = '0'`

### Properties

#### $_dms

inc.ClassUser.php : 61
`public object $_dms`

reference to the dms instance this user belongs to

##### Tags

access

  protected

#### $_id

inc.ClassUser.php : 32
`public int $_id`

id of role

##### Tags

access

  protected

#### $_name

inc.ClassUser.php : 39
`public string $_name`

name of role

##### Tags

access

  protected

#### $_noaccess

inc.ClassUser.php : 54
`public array<string|int, mixed> $_noaccess`

list of status without access

##### Tags

access

  protected

#### $_role

inc.ClassUser.php : 47
`public string $_role`

role of user. Can be one of SeedDMS_Core_Role::role_user, SeedDMS_Core_Role::role_admin, SeedDMS_Core_Role::role_guest

##### Tags

access

  protected

### Methods

#### __construct()

inc.ClassUser.php : 67
`public __construct(mixed $id, mixed $name, mixed $role[, mixed $noaccess = array() ]) : mixed`

##### Parameters

$id : mixed
$name : mixed
$role : mixed
$noaccess : mixed = array()

#### getAllInstances()

inc.ClassUser.php : 109
`public static getAllInstances(mixed $orderby, mixed $dms) : mixed`

##### Parameters

$orderby : mixed
$dms : mixed

#### getID()

inc.ClassUser.php : 136
`public getID() : mixed`

#### getInstance()

inc.ClassUser.php : 87

Create an instance of a role object

`public static getInstance(string|int $id, object $dms[, string $by = '' ]) : object`

##### Parameters

$id : string|int

  Id, login name, or email of user, depending on the 3rd parameter.

$dms : object

  instance of dms

$by : string = ''

  search by name. If 'name' is passed, the method will search by name instead of id. If this parameter is left empty, the role will be searched by its Id.

##### Return values

object —

instance of class SeedDMS_Core_User

#### getName()

inc.ClassUser.php : 138
`public getName() : mixed`

#### getNoAccess()

inc.ClassUser.php : 169
`public getNoAccess() : mixed`

#### getRole()

inc.ClassUser.php : 156
`public getRole() : mixed`

#### getUsers()

inc.ClassUser.php : 208
`public getUsers() : mixed`

#### isAdmin()

inc.ClassUser.php : 152
`public isAdmin() : mixed`

#### isGuest()

inc.ClassUser.php : 154
`public isGuest() : mixed`

#### isUsed()

inc.ClassUser.php : 198
`public isUsed() : mixed`

#### remove()

inc.ClassUser.php : 187

Delete role

`public remove() : bool`

##### Return values

bool —

true on success or false in case of an error

#### setDMS()

inc.ClassUser.php : 132
`public setDMS(mixed $dms) : mixed`

##### Parameters

$dms : mixed

#### setName()

inc.ClassUser.php : 140
`public setName(mixed $newName) : mixed`

##### Parameters

$newName : mixed

#### setNoAccess()

inc.ClassUser.php : 171
`public setNoAccess(mixed $noaccess) : mixed`

##### Parameters

$noaccess : mixed

#### setRole()

inc.ClassUser.php : 158
`public setRole(mixed $newrole) : mixed`

##### Parameters

$newrole : mixed

## Search results