PHP Class sspmod_consent_Store, simplesamlphp

Author: Olav Morken ([email protected])
Author: JAcob Christiansen ([email protected])
Show file Open project: simplesamlphp/simplesamlphp Class Usage Examples

Public Methods

Method 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.

Protected Methods

Method Description
__construct ( &$config ) Constructor for the base class.

Method Details

__construct() protected method

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

deleteAllConsents() public method

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

deleteConsent() abstract public method

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.
return mixed Should be the number of consent deleted.

getConsents() abstract public method

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.
return array Array of all destination ids the user has given consent for.

getStatistics() public method

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

hasConsent() abstract public method

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.
return boolean True if the user has given consent earlier, false if not (or on error).

parseStoreConfig() public static method

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.
return sspmod_consent_Store An object which implements the sspmod_consent_Store class.

saveConsent() abstract public method

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.
return boolean True if consent is succesfully saved otherwise false.