NAME

AxKit::App::TABOO::Data::User::Contributor - Contributor Data objects for TABOO

SYNOPSIS

use AxKit::App::TABOO::Data::User::Contributor;
$user = AxKit::App::TABOO::Data::User::Contributor->new(@dbconnectargs);
$user->load(what => '*', limit => {'username' => 'kjetil'});
my $fullname = $user->load_authlevel('kjetil');

DESCRIPTION

This Data class subclasses AxKit::App::TABOO::Data::User to add an authentication level and optional biographical information for a contributor to a site.

METHODS

This class implements two methods, the rest is inherited from AxKit::App::TABOO::Data::User.

new(@dbconnectargs)

The constructor. Makes sure that we inherit the data members from our superclass. Apart from that, nothing special.

load_authlevel($username)

This is an ad hoc method to retrieve the authorization level of a user, and it takes a $username key to identify whose level to retrieve. It will return a number that may be used to decide whether or not to grant access to an object or a data member. It will also populate the corresponding data fields of the object. You may therefore call write_xml on the object afterwards and have markup for the username and level.

save()

The save() method has been reimplemented in this class. It is less generic than the method of the grandparent class, but it saves data to two different tables, and should do its job well. It takes no parameters.

STORED DATA

The data is stored in named fields, and for certain uses, it is good to know them. If you want to subclass this class, you might want to use the same names, see the documentation of AxKit::APP::TABOO::Data for more about this.

In addition to the names of the parent, this class adds the following fields:

  • authlevel

    An integer representing the authorization level of a user. In the present implementation, it is a signed two-byte integer. It is intended to be used to decide whether or not to grant access to an object or a data member.

  • bio

    The contributors biographical information.

This is likely to be extended in future versions.

BUGS/TODO

You cannot use the save method in this class to save an object in the case where there is a record for the parent class, but lacks one for this class.

FORMALITIES

See AxKit::App::TABOO.