Freeside:1.7:Documentation:Developer/FS/access user

From Freeside
< Freeside:1.7:Documentation:Developer‎ | FS
Revision as of 17:51, 3 October 2007 by Ivan (talk | contribs) (import from POD)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

NAME

FS::access_user - Object methods for access_user records

SYNOPSIS

 use FS::access_user;

 $record = new FS::access_user \%hash;
 $record = new FS::access_user { 'column' => 'value' };

 $error = $record->insert;

 $error = $new_record->replace($old_record);

 $error = $record->delete;

 $error = $record->check;

DESCRIPTION

An FS::access_user object represents an internal access user. FS::access_user inherits from FS::Record. The following fields are currently supported:

usernum - primary key; username -; _password -; last -; first -; disabled - empty or 'Y'

METHODS

new HASHREF
Creates a new internal access user. To add the user to the database, see "insert".
Note that this stores the hash reference, not a distinct copy of the hash it points to. You can ask the object for a copy with the hash method.
insert
Adds this record to the database. If there is an error, returns the error, otherwise returns false.
delete
Delete this record from the database.
replace OLD_RECORD
Replaces the OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false.
check
Checks all fields to make sure this is a valid internal access user. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
name
Returns a name string for this user: "Last, First".
access_usergroup; agentnums
Returns a list of agentnums this user can view (via group membership).
agentnums_href
Returns a hashref of agentnums this user can view.
agentnums_sql
Returns an sql fragement to select only agentnums this user can view.
agentnum
Returns true if the user can view the specified agent.
agents
Returns the list of agents this user can view (via group membership), as FS::agent objects.
access_right
Given a right name, returns true if this user has this right (currently via group membership, eventually also via user overrides).

BUGS

SEE ALSO

FS::Record, schema.html from the base documentation.