The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

WE::DB - root of web editor database collection

SYNOPSIS

    $root = new WE::DB

DESCRIPTION

Instantiate a new root for a web.editor database. This class will usually be overwritten by a class doing the dirt work of opening the sub-databases. See WE_Singlesite::Root for an example.

CONSTRUCTOR new([%args])

If -class => Classname is specified, then a specialized class constructor will be used (for example WE_Sample::Root). Additional arguments are passed to this constructor.

METHODS

use_databases(@classes)

Tell the framework to use the given database classes. These classes will be automatically loaded.

The classes can be specified as abbreviated names (without a ":" in the class name), in this case WE::DB is automatically prepended.

The special class name :all represents the classes Obj, User and Content. Note that these are not really all available databases in a typical WE system.

login($user, $password)

Identify the user and do a login to the system by putting him to the OnlineUser database. Return true if everything was right.

logout($user)

Logout the user.

identify($user, $password)

Identify $user with $password and return true if the authentification is successful. Also set the CurrentUser member. This does not make any changes to the OnlineUser database.

is_allowed($action, $object_id)

Return a true value if the current user is allowed to do $action on object $object_id.

This method should be overridden, because it provides no access control in this form.

is_releasable_page($obj)

Return true if the given object is releasable. The default implementation always returns true.

root_object

Return the root object of the underlying object database

init

Initialize the underlying databases.

delete_db_contents

Delete the contents from all underlying databases.

delete_db

Delete all underlying databases. This will also remove the files, not just the contents as in delete_db_contents.

CurrentUser

Set or get the currently logged in user.

AUTHOR

Slaven Rezic - slaven@rezic.de

SEE ALSO

WE_Singlesite::Root, WE_Sample::Root.