热门在PicketLink(LDAP)中创建多对多关系?

时间:2015-10-28 14:30:43

标签: ldap picketlink

如何配置PicketLink(LDAP)来创建一些基本的多对多关系? 假设: 用户0< - > *角色0< - > *权限 因此,用户可以拥有多个角色,角色可以拥有多个权限。

在PicketLink中我可以创建一些角色并添加一些用户(甚至是自定义类):

member:user1
member:user2

但是如何在同一个角色或其他方式中添加一些权限以在LDAP \ PicketLink中创建多对多的实现? 所以我的角色看起来像这样或类似:

member:user1
memberPermission: permission1

我找到了一些信息: https://docs.jboss.org/picketlink/2/2.6.0.CR1/reference/html/ch09.html “LDAP配置支持单一类型的简单层次结构(父/子)的映射。” 是不是LDAP不能这样做?

我还尝试为某些自定义映射创建一些自定义成员资格类:

    .mapping(CustomGroup.class)
        .baseDN(CG_DN_SUFFIX)
        .objectClasses(GROUP_OF_NAMES)
        .attribute("name", CN, true)
        .readOnlyAttribute("createdDate", CREATE_TIMESTAMP)
        .parentMembershipAttributeName("member")
        //.parentMembershipAttributeName("usermember")
    .mapping(CustomGroupMembership.class)
        //configure which identity type is the owner of a relationship
        .forMapping(CustomGroup.class)
        .attribute("member", "member")
        .attribute("memberPermission", "memberPermission")

但是在运行时我遇到了一些错误,无法将其添加到我的关系管理器中。

有没有人见过在LDAP / PicketLink中做多对多关系的好例子? 或者可能有类似问题的解决方案?

1 个答案:

答案 0 :(得分:0)

我是LDAP的新手,但我也找不到这样做的方法,可能是因为LDAP就像树/层次结构而不是数据库。对于粗略的多对多(系统< - >用户< - >角色),我能想到的最好的是:

Rx = [1 0 0; 0 cos(theta) -sin(theta); 0 sin(theta) cos(theta)];
Ry = [cos(beta) 0 sin(beta); 0 1 0; -sin(beta) 0 cos(beta)];
Rz = [ cos(phi) -sin(phi) 0; sin(phi) cos(phi) 0; 0 0 1];
R = Rx * Ry * Rz;
T = projective2d( R );
I_deformed = imwarp(I,T);

member和roleOccupant都将distinguishedName作为其上级,因此期望DN作为值。 member属性设置为其他地方的角色条目(例如cn = ROLE,ou = systemRoles,dc = company),roleOccupant设置为用户(例如uid = USERNAME,ou = users,dc = company)。

我已经把系统放在了最前面,因为我希望我的应用程序能够知道它,但是如果你想找到给定用户更难的系统。如果可能的话,似乎最好避免多对多关系。