Solstice::Subgroup - Manages subsets of people.


Solstice documentation  | view source Contained in the Solstice distribution.

Index


NAME

Top

Solstice::Subgroup - Manages subsets of people.

SYNOPSIS

Top

  # See Solstice::Group
  #   This disables subgroup management, and classlists but is otherwise the same.

DESCRIPTION

Top

Manages sets of people, who are a subset of a specific group.

Export

No symbols exported.

Methods

new() =item new($group_id) =cut

sub new { my $obj = shift; my $input = shift;

    my $self = $obj->SUPER::new($input);

    return unless defined $self;

    unless (defined $input) {
        # This is a new subgroup, which is unsaved.  We need to be able to track it, 
        # So we'll give it a name that should be unique across all hosts...
        # If we're offline this will be null, and that's OK.
        my $host = $ENV{'SERVER_ADDR'} || '';
        $host =~ s/\./_/g;
        $self->_setID('unsaved_'.$$.'_'.$host.'_'.$id_creation_counter);
        $id_creation_counter++;
    }

    return $self;
}

clone()
delete()
store()

Saves the group to the data store. Returns TRUE on success, FALSE otherwise. Saving will fail if the following values are not defined: name, creator, and creating application.

getCreationDate()

Returns a Solstice::DateTime object, representing the date the group was first added to the data store. Returns undef if the group has never been saved to the data store.

_setCreationDate($date)

Sets the creation date of the group. Should only be set on retrieval from the data store.

getModificationDate()

Returns a Solstice::DateTime object, representing when the group was last modified in the data store. Returns undef if the group has never been saved to the data store.

_setModificationDate($date)

Sets the modification date of the group. Should only be set on retrieval from the data store.

getMembers()

Returns a Solstice::List, containing Solstice::Person::<X> objects. This list constists of all members of the groups, excluding member groups, or people who are in LDAP groups.

getMemberCount()

Returns the number of members for the group.

isMember($person)

Returns TRUE if the given person is a member of this group, recursively, FALSE otherwise.

addMember($person)

Adds the given person object to the group. A person can only be added to a group once, though multiple adds will not result in an error being raised.

removeMember($person)

Removes the given person from the group. This only removes the user from the group itself, it does not traverse into member groups, or modify any entries for an LDAP group.

getAllMembers()

Returns a Solstice::List, containing all members of the groups, including members of member groups, and members of LDAP groups.

Private Methods

_initFromHash ($hash_ref) =cut

sub _initFromHash { my $self = shift; my $input = shift;

    $self->{'_initialized_subgroups'} = FALSE;
    $self->{'_initialized_members'} = FALSE;

    $self->_setID($input->{'id'});
    $self->setName($input->{'name'});
    $self->_setModificationDate($input->{'modification_date'});
    $self->_setCreationDate($input->{'creation_date'});
    $self->setRootGroupID($input->{'root_group_id'});

    return TRUE;
}

_initMin($group_id)

Initializes the minimum amount of data about the group as it can. Loads no member groups, subgroups, people, or class lists.

_initializeMembers()

Goes to the data store to retrive the list of members for this group.

_initializeOwners()
_initializeMemberGroups()
_initializeRemoteGroups()
_initializeSubgroups()

Goes to the data store to retrieve the list of subgroups for this group.

_getAllMembers($seen_group_hash)

A private method for recursing through groups, getting membership lists.

_populateMemberHash(\%member_hash)

Function that builds a hash of group members

_populateDBMemberHash(\%member_hash)
_getAccessorDefinition()

Returns the array_ref that creates the basic accessors of Solstice::Group.

AUTHOR

Top

Catalyst Group, <catalyst@u.washington.edu>

VERSION

Top

$Revision: $

COPYRIGHT

Top


Solstice documentation  | view source Contained in the Solstice distribution.