NAME

MACS::RMA -- macs' Resource Management Agent internals.


SYNOPSIS

  use MACS::RMA;
  MACS::RMA::init();
  @idpath = MACS::RMA::get_path_id(\@path);
  ...


TODO

The databasing in this module should be moved to MACS::DBI and called from there.


DESCRIPTION

MACS::RMA implements macs' Resource Management internals. It is very simple to use, just 'use' it, call MACS::RMA::init(), and use any of the following functions according to its instructions: (Note that none of these functions are exportable to the callers namespace, and therefore need to be fully qualified!)

init(ctx)
Prepare MACS::RMA for use. ctx must be a valid MACS::CClient context object. This function must be called before any others!

FIXME: There is a small race condition in this code. I think it's harmless, but there it is.

get_root_resources()
Returns a hash of resource tree roots, keyed by path.

get_resource_children(id)
get the children of the given path id

get_path_id(path)
Get a list of ids for a given path

get_id_path(id)
Get a path for a given id

get_resource_perms(ids)
Get the permissions of the given ids, which is an array of resource IDs.

get_groups()
Returns a hash of group id's, keyed by their path.

set_resource_perms(id,set,disable,owner,admin,read,write,groups)
set (or delete, if set is false) the disable, owner, admin, read, and write permissions on the given resource id for each group in groups.

create_resource(parent,name)
create a resource name under parent

create_group(name)
Create a group with the given name.

FIXME: This is not completely general. (Ie, it's a hack.)