Net::LDAP::Class::Group::POSIX - group class for POSIX LDAP schema


Net-LDAP-Class documentation  | view source Contained in the Net-LDAP-Class distribution.

Index


NAME

Top

Net::LDAP::Class::Group::POSIX - group class for POSIX LDAP schema

SYNOPSIS

Top

 # create a subclass for your local LDAP
 package MyLDAPGroup;
 use base qw( Net::LDAP::Class::Group::POSIX );

 __PACKAGE__->metadata->setup(
     base_dn             => 'dc=mycompany,dc=com',
    attributes          => __PACKAGE__->POSIX_attributes,
    unique_attributes   => __PACKAGE__->POSIX_unique_attributes,
 );

 1;

 # then use your class
 my $ldap = get_and_bind_LDAP_object(); # you write this

 use MyLDAPGroup;
 my $group = MyLDAPGroup->new( ldap => $ldap, cn   => 'foobar' );
 $group->read_or_create;
 for my $user ($group->users) {
     printf("user %s in group %s\n", $user, $group);
 }

DESCRIPTION

Top

Net::LDAP::Class::Group::POSIX isa Net::LDAP::Class::Group implementing the POSIX LDAP schema.

CLASS METHODS

Top

POSIX_attributes

Returns array ref of 'cn', 'gidNumber' and 'memberUid'.

POSIX_unique_attributes

Returns array ref of 'cn' and 'gidNumber'.

OBJECT METHODS

Top

read

Overrides (and calls) base method to perform additional sanity check that the matching organizational unit exists for the primary posixGroup.

action_for_create([ cn => cn_value, gidNumber => gid ])

Add a group to the database.

May be called as a class method with explicit cn and gidNumber key/value pairs.

action_for_update

Save new gidNumber (gid) or cn (name) for an existing group.

NOTE: Because of the POSIX schema layout, renaming a group means creating a new group, moving existing users into it, and deleting the old group. This is handled transparently in action_for_update().

action_for_delete( [cn => cn_value] )

Returns array ref of actions for removing the organizational unit and the posixGroup.

You may call this as a class method with an explicit cn key/value pair.

fetch_primary_users

Required MethodMaker method for retrieving primary_users from LDAP.

Returns array or array ref based on context, of related User objects who have this group assigned as their primary group.

primary_users_iterator

Returns Net::LDAP::Class::Iterator for the same query as fetch_primary_users().

See the advice in Net::LDAP::Class::Iterator about iterators versus arrays.

fetch_secondary_users

Required MethodMaker method for retrieving secondary_users from LDAP.

Returns array or array ref based on context, of related User objects who have this group assigned as a secondary group.

Consider using secondary_users_iterator() instead, especially if you have large groups. See Net::LDAP::Class::Iterator for an explanation. This method is just a wrapper around secondary_users_iterator().

secondary_users_iterator([opts])

Returns Net::LDAP::Class::SimpleIterator for the same query as fetch_secondary_users().

See the advice in Net::LDAP::Class::Iterator about iterators versus arrays.

gid

Alias for gidNumber() attribute.

AUTHOR

Top

Peter Karman, <karman at cpan.org>

BUGS

Top

Please report any bugs or feature requests to bug-net-ldap-class at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-LDAP-Class. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc Net::LDAP::Class

You can also look for information at:

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/Net-LDAP-Class

* CPAN Ratings

http://cpanratings.perl.org/d/Net-LDAP-Class

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-LDAP-Class

* Search CPAN

http://search.cpan.org/dist/Net-LDAP-Class

ACKNOWLEDGEMENTS

Top

The Minnesota Supercomputing Institute http://www.msi.umn.edu/ sponsored the development of this software.

COPYRIGHT

Top

SEE ALSO

Top

Net::LDAP


Net-LDAP-Class documentation  | view source Contained in the Net-LDAP-Class distribution.