ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
sspmod_consent_Store Class Reference
+ Inheritance diagram for sspmod_consent_Store:
+ Collaboration diagram for sspmod_consent_Store:

Public Member Functions

 hasConsent ($userId, $destinationId, $attributeSet)
 Check for consent. More...
 
 saveConsent ($userId, $destinationId, $attributeSet)
 Save consent. More...
 
 deleteConsent ($userId, $destinationId)
 Delete consent. More...
 
 deleteAllConsents ($userId)
 Delete all consents. More...
 
 getStatistics ()
 Get statistics for all consent given in the consent store. More...
 
 getConsents ($userId)
 Retrieve consents. More...
 

Static Public Member Functions

static parseStoreConfig ($config)
 Parse consent storage configuration. More...
 

Protected Member Functions

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

Detailed Description

Definition at line 9 of file Store.php.

Constructor & Destructor Documentation

◆ __construct()

sspmod_consent_Store::__construct ( $config)
protected

Constructor for the base class.

This constructor should always be called first in any class which implements this class.

Parameters
array&$configThe configuration for this storage handler.

Definition at line 18 of file Store.php.

19 {
20 assert('is_array($config)');
21 }

Member Function Documentation

◆ deleteAllConsents()

sspmod_consent_Store::deleteAllConsents (   $userId)

Delete all consents.

Called when a user revokes all consents

Parameters
string$userIdThe hash identifying the user at an IdP.
Returns
mixed Should be the number of consent removed
Exceptions
Exception

Reimplemented in sspmod_consent_Consent_Store_Cookie, and sspmod_consent_Consent_Store_Database.

Definition at line 79 of file Store.php.

80 {
81 throw new Exception('Not implemented: deleteAllConsents()');
82 }

◆ deleteConsent()

sspmod_consent_Store::deleteConsent (   $userId,
  $destinationId 
)
abstract

Delete consent.

Called when a user revokes consent for a given destination.

Parameters
string$userIdThe hash identifying the user at an IdP.
string$destinationIdA string which identifyes the destination.
Returns
mixed Should be the number of consent deleted.

Reimplemented in sspmod_consent_Consent_Store_Cookie, and sspmod_consent_Consent_Store_Database.

◆ getConsents()

sspmod_consent_Store::getConsents (   $userId)
abstract

Retrieve consents.

This function should return a list of consents the user has saved.

Parameters
string$userIdThe hash identifying the user at an IdP.
Returns
array Array of all destination ids the user has given consent for.

Reimplemented in sspmod_consent_Consent_Store_Cookie, and sspmod_consent_Consent_Store_Database.

◆ getStatistics()

sspmod_consent_Store::getStatistics ( )

Get statistics for all consent given in the consent store.

Returns
mixed Statistics from the consent store
Exceptions
Exception

Reimplemented in sspmod_consent_Consent_Store_Database.

Definition at line 92 of file Store.php.

93 {
94 throw new Exception('Not implemented: getStatistics()');
95 }

◆ hasConsent()

sspmod_consent_Store::hasConsent (   $userId,
  $destinationId,
  $attributeSet 
)
abstract

Check for consent.

This function checks whether a given user has authorized the release of the attributes identified by $attributeSet from $source to $destination.

Parameters
string$userIdThe hash identifying the user at an IdP.
string$destinationIdA string which identifyes the destination.
string$attributeSetA hash which identifies the attributes.
Returns
bool True if the user has given consent earlier, false if not (or on error).

Reimplemented in sspmod_consent_Consent_Store_Cookie, and sspmod_consent_Consent_Store_Database.

◆ parseStoreConfig()

static sspmod_consent_Store::parseStoreConfig (   $config)
static

Parse consent storage configuration.

This function parses the configuration for a consent storage method. An exception will be thrown if configuration parsing fails.

Parameters
mixed$configThe configuration.
Returns
sspmod_consent_Store An object which implements the sspmod_consent_Store class.
Exceptions
Exceptionif the configuration is invalid.

Definition at line 122 of file Store.php.

123 {
124 if (is_string($config)) {
125 $config = array($config);
126 }
127
128 if (!is_array($config)) {
129 throw new Exception('Invalid configuration for consent store option: '.var_export($config, true));
130 }
131
132 if (!array_key_exists(0, $config)) {
133 throw new Exception('Consent store without name given.');
134 }
135
137 $config[0],
138 'Consent_Store',
139 'sspmod_consent_Store'
140 );
141
142 unset($config[0]);
143 return new $className($config);
144 }
static resolveClass($id, $type, $subclass=null)
Resolve module class.
Definition: Module.php:252

References $config, and SimpleSAML\Module\resolveClass().

Referenced by sspmod_consent_Auth_Process_Consent\__construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveConsent()

sspmod_consent_Store::saveConsent (   $userId,
  $destinationId,
  $attributeSet 
)
abstract

Save consent.

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.

Parameters
string$userIdThe hash identifying the user at an IdP.
string$destinationIdA string which identifyes the destination.
string$attributeSetA hash which identifies the attributes.
Returns
bool True if consent is succesfully saved otherwise false.

Reimplemented in sspmod_consent_Consent_Store_Cookie, and sspmod_consent_Consent_Store_Database.


The documentation for this class was generated from the following file: