Class PermissionsChecker.

Inherits Garbage

The PermissionsChecker class is a convenience mangler. It collects a set of Permissions and Permissions::Right objects, and checks that all are allowed. If not, it generates a suitable error message.

PermissionsChecker::PermissionsChecker()

Constructs an empty PermissionsChecker. Pretty much a noop.

Reimplements Garbage::Garbage().

bool PermissionsChecker::allowed() const

Returns true if all all Permissions objects specified using require() allow the relevant right, and false in all other cases.

EString PermissionsChecker::error() const

Returns an error string describing the missing permissions. If allowed() returns true, this is an empty string. If allowed() is false, it is a long, perhaps multi-line string.

If ready() returns false, this function returns an almost random string.

Permissions * PermissionsChecker::permissions( Mailbox * m, User * u ) const

Returns a Permissions object for m, u if this PermissionsChecker happens to have one, and returns a null pointer if it doesn't.

bool PermissionsChecker::ready() const

Returns true if this checker can return a valid result, and false if at least one Permissions object still doesn't have the data it needs.

void PermissionsChecker::require( Permissions * p, Permissions::Right r )

Notes that this object's user requires r on p.

This web page based on source code belonging to The Archiveopteryx Developers. All rights reserved.