TreeFrogFramework  2.8
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 TActionController *controller) const
 

Protected Member Functions

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

Protected Attributes

bool allowDefault {true}
 
QList< AccessRuleaccessRules
 

Detailed Description

The TAccessValidator class provides validation of user access.

The TAccessValidator class provides the functionality of a validation for form data.

See also
TAbstractUser class

Constructor & Destructor Documentation

◆ TAccessValidator()

TAccessValidator::TAccessValidator ( )

Constructor.

◆ ~TAccessValidator()

virtual TAccessValidator::~TAccessValidator ( )
inlinevirtual

Member Function Documentation

◆ addRules()

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

Added a access rule to the list.

◆ clear()

void TAccessValidator::clear ( )

Removes all access rules from the list.

◆ setAllowDefault()

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.

◆ setAllowGroup() [1/2]

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

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

◆ setAllowGroup() [2/2]

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

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

◆ setAllowUnauthenticatedUser() [1/2]

void TAccessValidator::setAllowUnauthenticatedUser ( const QString &  action)

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

◆ setAllowUnauthenticatedUser() [2/2]

void TAccessValidator::setAllowUnauthenticatedUser ( const QStringList &  actions)

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

◆ setAllowUser() [1/2]

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

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

◆ setAllowUser() [2/2]

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

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

◆ setDenyDefault()

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.

◆ setDenyGroup() [1/2]

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

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

◆ setDenyGroup() [2/2]

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

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

◆ setDenyUnauthenticatedUser() [1/2]

void TAccessValidator::setDenyUnauthenticatedUser ( const QString &  action)

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

◆ setDenyUnauthenticatedUser() [2/2]

void TAccessValidator::setDenyUnauthenticatedUser ( const QStringList &  actions)

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

◆ setDenyUser() [1/2]

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

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

◆ setDenyUser() [2/2]

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

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

◆ validate()

bool TAccessValidator::validate ( const TAbstractUser user,
const TActionController controller 
) const
virtual

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

Member Data Documentation

◆ accessRules

QList<AccessRule> TAccessValidator::accessRules
protected

◆ allowDefault

bool TAccessValidator::allowDefault {true}
protected

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