PHP Class sspmod_consent_Store, simplesamlphp

Author: Olav Morken ([email protected])
Author: JAcob Christiansen ([email protected])
Afficher le fichier Open project: simplesamlphp/simplesamlphp Class Usage Examples

Méthodes publiques

Méthode Description
deleteAllConsents ( string $userId ) : mixed Delete all consents.
deleteConsent ( string $userId, string $destinationId ) : mixed Delete consent.
getConsents ( string $userId ) : array Retrieve consents.
getStatistics ( ) : mixed Get statistics for all consent given in the consent store
hasConsent ( string $userId, string $destinationId, string $attributeSet ) : boolean Check for consent.
parseStoreConfig ( mixed $config ) : sspmod_consent_Store Parse consent storage configuration.
saveConsent ( string $userId, string $destinationId, string $attributeSet ) : boolean Save consent.

Méthodes protégées

Méthode Description
__construct ( &$config ) Constructor for the base class.

Method Details

__construct() protected méthode

This constructor should always be called first in any class which implements this class.
protected __construct ( &$config )

deleteAllConsents() public méthode

Called when a user revokes all consents
public deleteAllConsents ( string $userId ) : mixed
$userId string The hash identifying the user at an IdP.
Résultat mixed Should be the number of consent removed

deleteConsent() abstract public méthode

Called when a user revokes consent for a given destination.
abstract public deleteConsent ( string $userId, string $destinationId ) : mixed
$userId string The hash identifying the user at an IdP.
$destinationId string A string which identifyes the destination.
Résultat mixed Should be the number of consent deleted.

getConsents() abstract public méthode

This function should return a list of consents the user has saved.
abstract public getConsents ( string $userId ) : array
$userId string The hash identifying the user at an IdP.
Résultat array Array of all destination ids the user has given consent for.

getStatistics() public méthode

Get statistics for all consent given in the consent store
public getStatistics ( ) : mixed
Résultat mixed Statistics from the consent store

hasConsent() abstract public méthode

This function checks whether a given user has authorized the release of the attributes identified by $attributeSet from $source to $destination.
abstract public hasConsent ( string $userId, string $destinationId, string $attributeSet ) : boolean
$userId string The hash identifying the user at an IdP.
$destinationId string A string which identifyes the destination.
$attributeSet string A hash which identifies the attributes.
Résultat boolean True if the user has given consent earlier, false if not (or on error).

parseStoreConfig() public static méthode

This function parses the configuration for a consent storage method. An exception will be thrown if configuration parsing fails.
public static parseStoreConfig ( mixed $config ) : sspmod_consent_Store
$config mixed The configuration.
Résultat sspmod_consent_Store An object which implements the sspmod_consent_Store class.

saveConsent() abstract public méthode

Called when the user asks for the consent to be saved. If consent information for the given user and destination already exists, it should be overwritten.
abstract public saveConsent ( string $userId, string $destinationId, string $attributeSet ) : boolean
$userId string The hash identifying the user at an IdP.
$destinationId string A string which identifyes the destination.
$attributeSet string A hash which identifies the attributes.
Résultat boolean True if consent is succesfully saved otherwise false.