TreeFrogFramework  1.18
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TAccessValidator Class Reference

#include <taccessvalidator.h>

Inheritance diagram for TAccessValidator:
Inheritance graph
[legend]

Classes

class  AccessRule
 

Public Member Functions

 TAccessValidator ()
 
virtual ~TAccessValidator ()
 
void setAllowDefault (bool allow=true)
 
void setDenyDefault (bool deny=true)
 
void setAllowGroup (const QString &groupKey, const QString &action)
 
void setAllowGroup (const QString &groupKey, const QStringList &actions)
 
void setDenyGroup (const QString &groupKey, const QString &action)
 
void setDenyGroup (const QString &groupKey, const QStringList &actions)
 
void setAllowUser (const QString &identityKey, const QString &action)
 
void setAllowUser (const QString &identityKey, const QStringList &actions)
 
void setDenyUser (const QString &identityKey, const QString &action)
 
void setDenyUser (const QString &identityKey, const QStringList &actions)
 
void setAllowUnauthenticatedUser (const QString &action)
 
void setAllowUnauthenticatedUser (const QStringList &actions)
 
void setDenyUnauthenticatedUser (const QString &action)
 
void setDenyUnauthenticatedUser (const QStringList &actions)
 
void clear ()
 
virtual bool validate (const TAbstractUser *user) const
 

Protected Member Functions

void addRules (int type, const QString &key, const QStringList &actions, bool allow)
 

Protected Attributes

bool allowDefault
 
QList< AccessRuleaccessRules
 

Detailed Description

The TAccessValidator class provides validation of user access.

See also
TAbstractUser class

Constructor & Destructor Documentation

TAccessValidator::TAccessValidator ( )

Constructor.

virtual TAccessValidator::~TAccessValidator ( )
inlinevirtual

Member Function Documentation

void TAccessValidator::addRules ( int  type,
const QString &  key,
const QStringList &  actions,
bool  allow 
)
protected

Added a access rule to the list.

void TAccessValidator::clear ( )

Removes all access rules from the list.

void TAccessValidator::setAllowDefault ( bool  allow = true)
inline

Sets the default rule to allow all users to access to all actions if allow is true; otherwise sets to deny any user to access to any action.

The default rule is true.

void TAccessValidator::setAllowGroup ( const QString &  groupKey,
const QString &  action 
)

Sets to allow a group with groupKey to access to the action action.

void TAccessValidator::setAllowGroup ( const QString &  groupKey,
const QStringList &  actions 
)

Sets to allow a group with groupKey to access to the actions actions.

void TAccessValidator::setAllowUnauthenticatedUser ( const QString &  action)

Sets to allow an unauthenticated user with the identity identityKey to access to the action action.

void TAccessValidator::setAllowUnauthenticatedUser ( const QStringList &  actions)

Sets to allow an unauthenticated with the identity identityKey to access to the actions actions.

void TAccessValidator::setAllowUser ( const QString &  identityKey,
const QString &  action 
)

Sets to allow a user with the identity identityKey to access to the action action.

void TAccessValidator::setAllowUser ( const QString &  identityKey,
const QStringList &  actions 
)

Sets to allow a user with the identity identityKey to access to the actions actions.

void TAccessValidator::setDenyDefault ( bool  deny = true)
inline

Sets the default rule to deny any user to access to any action if deny is true; otherwise sets to allow all users to access to all actions.

void TAccessValidator::setDenyGroup ( const QString &  groupKey,
const QString &  action 
)

Sets to deny a group with groupKey to access to the action action.

void TAccessValidator::setDenyGroup ( const QString &  groupKey,
const QStringList &  actions 
)

Sets to deny a group with groupKey to access to the actions actions.

void TAccessValidator::setDenyUnauthenticatedUser ( const QString &  action)

Sets to deny an unauthenticated with the identity identityKey to access to the action action.

void TAccessValidator::setDenyUnauthenticatedUser ( const QStringList &  actions)

Sets to deny an unauthenticated with the identity identityKey to access to the actions actions.

void TAccessValidator::setDenyUser ( const QString &  identityKey,
const QString &  action 
)

Sets to deny a user with the identity identityKey to access to the action action.

void TAccessValidator::setDenyUser ( const QString &  identityKey,
const QStringList &  actions 
)

Sets to deny a user with the identity identityKey to access to the actions actions.

bool TAccessValidator::validate ( const TAbstractUser user) const
virtual

Returns true if the user user is allowed to access to the requested action; otherwise returns false.

Member Data Documentation

QList<AccessRule> TAccessValidator::accessRules
protected
bool TAccessValidator::allowDefault
protected

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