PHP Class AppserverIo\Appserver\ServletEngine\Security\SimpleGroup

Inheritance: extends SimplePrincipal, implements AppserverIo\Psr\Security\Acl\GroupInterface
Afficher le fichier Open project: appserver-io/appserver

Méthodes publiques

Méthode Description
__construct ( string $name ) Initialize the principal with the passed name.
__toString ( ) : string Returns the principals name as string.
addMember ( AppserverIo\Psr\Security\PrincipalInterface $pricipal ) : boolean Adds the passed principal to the group.
getMembers ( ) : AppserverIo\Collections\HashMap Return's the group's members.
isMember ( AppserverIo\Psr\Security\PrincipalInterface $principal ) : boolean Returns TRUE if the passed principal is a member of the group.
removeMember ( AppserverIo\Psr\Security\PrincipalInterface $principal ) : boolean Removes the passed principal from the group.

Method Details

__construct() public méthode

Initialize the principal with the passed name.
public __construct ( string $name )
$name string The principal's name

__toString() public méthode

Returns the principals name as string.
public __toString ( ) : string
Résultat string The principal's name

addMember() public méthode

Adds the passed principal to the group.
public addMember ( AppserverIo\Psr\Security\PrincipalInterface $pricipal ) : boolean
$pricipal AppserverIo\Psr\Security\PrincipalInterface The principal to add
Résultat boolean TRUE if the member was successfully added, FALSE if the principal was already a member

getMembers() public méthode

Return's the group's members.
public getMembers ( ) : AppserverIo\Collections\HashMap
Résultat AppserverIo\Collections\HashMap The group members

isMember() public méthode

This method does a recursive search, so if a principal belongs to a group which is a member of this group, true is returned. A special check is made to see if the member is an instance of AnybodyPrincipal or NobodyPrincipal since these classes do not hash to meaningful values.
public isMember ( AppserverIo\Psr\Security\PrincipalInterface $principal ) : boolean
$principal AppserverIo\Psr\Security\PrincipalInterface The principal to query membership for
Résultat boolean TRUE if the principal is a member of this group, FALSE otherwise

removeMember() public méthode

Removes the passed principal from the group.
public removeMember ( AppserverIo\Psr\Security\PrincipalInterface $principal ) : boolean
$principal AppserverIo\Psr\Security\PrincipalInterface The principal to remove
Résultat boolean TRUE if the member was successfully removed, FALSE if the principal was not a member