PHP Class Scalr\Model\Entity\Account\User

Since: 5.4.0 (21.02.2015)
Author: Vitaliy Demidov ([email protected])
Inheritance: extends Scalr\Model\AbstractEntity
Afficher le fichier Open project: scalr/scalr Class Usage Examples

Méthodes publiques

Свойство Type Description
$accountId integer Identifier of the account which User corresponds to
$comments string The comments
$created DateTime The timestamp when the record is created
$email string The email address of the user
$fullName string The full name of the User
$id integer The identifier of the User
$lastLogin DateTime The last timemestamp when the User signed in
$loginAttempts integer The number of failed sign-in attempts
$password string The password
$status string The status of the User
$type string The type

Méthodes publiques

Méthode Description
__construct ( ) Constructor
applyLdapGroups ( $groups ) Special method for LDAP auth sync LDAP groups to Scalr groups
canEditUser ( User $user ) : boolean Checks whether the user is allowed to edit specified user
canManageAcl ( ) : boolean Checks whether the user is allowed to manage ACL
canRemoveUser ( User $user ) : boolean Checks whether the user is allowed to remove specified user
fetchSettings ( ) : array Fetches all settings from the database
getAccount ( ) : Client Gets account entity
getAccountId ( ) : integer Gets Identifier of the Account
getAclRoles ( boolean $ignoreCache = false ) : Scalr\Acl\Role\AccountRoleSuperposition Gets account level roles
getAclRolesByEnvironment ( integer $envId, boolean $ignoreCache = false ) : Scalr\Acl\Role\AccountRoleSuperposition Gets roles by specified identifier of the Environment
getEmail ( ) : string Gets email address of the User
getEnvironments ( string $filter = null ) : array Gets environments of the current user filtered by name
getId ( ) : integer Gets Identifier of the User
getLdapUsername ( ) : string Gets LDAP username of the User
getSetting ( string $name, boolean $useCache = true ) : string | null Gets specified setting
getTeams ( ) : array Gets user teams
hasAccessToEnvironment ( integer $envId ) : boolean Checks whether this user has access to the specified environment
inTeam ( integer $teamId ) : boolean Check if user is included in team
isAccountAdmin ( ) : boolean Checks if the user is account admin
isAccountOwner ( ) : boolean Checks if the user is account owher
isAccountSuperAdmin ( ) : boolean Checks if the user is account admin
isAdmin ( ) : boolean Checks if the user is admin user (scalr, financial). It means user doesn't have current environment
isFinAdmin ( ) : boolean Checks if the user is Financial admin
isScalrAdmin ( ) : boolean Checks if the user is Scalr admin
isTeamUser ( ) : boolean Checks if the user is team user
isUser ( ) : boolean Checks if the user is account user (owner, admin, team user)
saveSetting ( string $name, string $value ) : User Saves the value of the specified setting to the database
setSetting ( string $name, string $value ) : User Sets the value of the specified setting

Method Details

__construct() public méthode

Constructor
public __construct ( )

applyLdapGroups() public méthode

Special method for LDAP auth sync LDAP groups to Scalr groups
public applyLdapGroups ( $groups )
$groups

canEditUser() public méthode

Checks whether the user is allowed to edit specified user
public canEditUser ( User $user ) : boolean
$user User The user to edit
Résultat boolean Returns true if the user is allowed to edit specified user

canManageAcl() public méthode

Checks whether the user is allowed to manage ACL
public canManageAcl ( ) : boolean
Résultat boolean Returns true if user is allowed to manage ACL

canRemoveUser() public méthode

Checks whether the user is allowed to remove specified user
public canRemoveUser ( User $user ) : boolean
$user User The user to remove
Résultat boolean Returns true if the user is allowed to remove specified user

fetchSettings() public méthode

Fetches all settings from the database
public fetchSettings ( ) : array
Résultat array Returns all settings

getAccount() public méthode

Gets account entity
public getAccount ( ) : Client
Résultat Scalr\Model\Entity\Client

getAccountId() public méthode

Gets Identifier of the Account
public getAccountId ( ) : integer
Résultat integer Returns identifier of the Account

getAclRoles() public méthode

Gets account level roles
public getAclRoles ( boolean $ignoreCache = false ) : Scalr\Acl\Role\AccountRoleSuperposition
$ignoreCache boolean Whether it shoud ignore cache
Résultat Scalr\Acl\Role\AccountRoleSuperposition Returns the list of the roles of account level

getAclRolesByEnvironment() public méthode

Gets roles by specified identifier of the Environment
public getAclRolesByEnvironment ( integer $envId, boolean $ignoreCache = false ) : Scalr\Acl\Role\AccountRoleSuperposition
$envId integer The identifier of the Environment
$ignoreCache boolean optional Whether it should ignore cache
Résultat Scalr\Acl\Role\AccountRoleSuperposition Returns the list of the roles of account level by specified environment

getEmail() public méthode

Gets email address of the User
public getEmail ( ) : string
Résultat string Returns user email address

getEnvironments() public méthode

Gets environments of the current user filtered by name
public getEnvironments ( string $filter = null ) : array
$filter string optional Filter string
Résultat array

getId() public méthode

Gets Identifier of the User
public getId ( ) : integer
Résultat integer Returns identifier of the User

getLdapUsername() public méthode

Gets LDAP username of the User
public getLdapUsername ( ) : string
Résultat string Returns LDAP username

getSetting() public méthode

Gets specified setting
public getSetting ( string $name, boolean $useCache = true ) : string | null
$name string The name of the setting
$useCache boolean optional Whether it should use cache
Résultat string | null Returns the value on success or NULL if it does not exist.

getTeams() public méthode

Gets user teams
public getTeams ( ) : array
Résultat array

hasAccessToEnvironment() public méthode

Checks whether this user has access to the specified environment
public hasAccessToEnvironment ( integer $envId ) : boolean
$envId integer The identifier of the environment
Résultat boolean Returns TRUE if the user has access to the specified environment

inTeam() public méthode

Check if user is included in team
public inTeam ( integer $teamId ) : boolean
$teamId integer
Résultat boolean

isAccountAdmin() public méthode

Checks if the user is account admin
public isAccountAdmin ( ) : boolean
Résultat boolean Returns true if user is account admin

isAccountOwner() public méthode

Checks if the user is account owher
public isAccountOwner ( ) : boolean
Résultat boolean Returns true if user is account owner.

isAccountSuperAdmin() public méthode

Checks if the user is account admin
public isAccountSuperAdmin ( ) : boolean
Résultat boolean Returns true if user is account super admin

isAdmin() public méthode

Checks if the user is admin user (scalr, financial). It means user doesn't have current environment
public isAdmin ( ) : boolean
Résultat boolean

isFinAdmin() public méthode

Checks if the user is Financial admin
public isFinAdmin ( ) : boolean
Résultat boolean Returns true if user is Financial Admin

isScalrAdmin() public méthode

Checks if the user is Scalr admin
public isScalrAdmin ( ) : boolean
Résultat boolean Returns true if user is Scalr Admin

isTeamUser() public méthode

Checks if the user is team user
public isTeamUser ( ) : boolean
Résultat boolean Returns true if user is team user

isUser() public méthode

Checks if the user is account user (owner, admin, team user)
public isUser ( ) : boolean
Résultat boolean

saveSetting() public méthode

Saves the value of the specified setting to the database
public saveSetting ( string $name, string $value ) : User
$name string The name of the setting
$value string The value
Résultat User

setSetting() public méthode

Sets the value of the specified setting
public setSetting ( string $name, string $value ) : User
$name string The name of the setting
$value string The value
Résultat User

Property Details

$accountId public_oe property

Identifier of the account which User corresponds to
public int $accountId
Résultat integer

$comments public_oe property

The comments
public string $comments
Résultat string

$created public_oe property

The timestamp when the record is created
public DateTime $created
Résultat DateTime

$email public_oe property

The email address of the user
public string $email
Résultat string

$fullName public_oe property

The full name of the User
public string $fullName
Résultat string

$id public_oe property

The identifier of the User
public int $id
Résultat integer

$lastLogin public_oe property

The last timemestamp when the User signed in
public DateTime $lastLogin
Résultat DateTime

$loginAttempts public_oe property

The number of failed sign-in attempts
public int $loginAttempts
Résultat integer

$password public_oe property

The password
public string $password
Résultat string

$status public_oe property

The status of the User
public string $status
Résultat string

$type public_oe property

The type
public string $type
Résultat string