Skip to content

Commit

Permalink
LDAP: add support for group membership lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
brong committed Apr 1, 2024
1 parent 2c0cfef commit 6a03fca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cassandane/Cassandane/Cyrus/LDAP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ sub new
ldap_domain_base_dn => "ou=domains,o=cyrus",
ldap_user_attribute => "uid",
ldap_member_attribute => "memberof",
ldap_group_hasmember_attribute => "hasmember",
ldap_sasl => "no",
auth_mech => 'pts',
pts_module => 'ldap',
Expand Down Expand Up @@ -216,7 +217,7 @@ sub test_list_groupaccess_noracl
}

sub test_list_groupaccess_racl
:needs_dependency_ldap :ReverseACLs :min_version_3_1 :NoAltNamespace
:needs_dependency_ldap :ReverseACLs :min_version_3_1 :NoAltNamespace :Conversations
{
my ($self) = @_;

Expand All @@ -227,11 +228,16 @@ sub test_list_groupaccess_racl
$self->assert_str_equals('ok',
$admintalk->get_last_completion_response());

my $precounters = $self->{store}->get_counters();

$admintalk->setacl("user.otheruser.groupaccess",
"group:group co", "lrswipkxtecdn");
$self->assert_str_equals('ok',
$admintalk->get_last_completion_response());

my $postcounters = $self->{store}->get_counters();
$self->assert_num_not_equals($precounters->{raclmodseq}, $postcounters->{raclmodseq}, "RACL modseq changed");

if (get_verbose()) {
$self->{instance}->run_command(
{ cyrus => 1, },
Expand Down
4 changes: 4 additions & 0 deletions cassandane/data/directory.ldif
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,16 @@ objectclass: group
cn: group co
ou: groups
o: cyrus
hasmember: cassandane
hasmember: otheruser

dn: cn=group c,ou=groups,o=cyrus
objectclass: group
cn: group c
ou: groups
o: cyrus
hasmember: cassandane
hasmember: otheruser

dn: cn=group o,ou=groups,o=cyrus
objectclass: group
Expand Down

0 comments on commit 6a03fca

Please sign in to comment.