Skip to Content.
Sympa Menu

grouper-dev - RE: [grouper-dev] Grouper design call, Wednesday, 16 September 2009, 1200EDT (1600Z)

Subject: Grouper Developers Forum

List archive

RE: [grouper-dev] Grouper design call, Wednesday, 16 September 2009, 1200EDT (1600Z)


Chronological Thread 
  • From: Chris Hyzer <>
  • To: Tom Barton <>, "" <>
  • Subject: RE: [grouper-dev] Grouper design call, Wednesday, 16 September 2009, 1200EDT (1600Z)
  • Date: Thu, 17 Sep 2009 00:26:19 -0400
  • Accept-language: en-US
  • Acceptlanguage: en-US

As I hoped, directed graphs for role inheritance was not a big deal when
reusing the interface used by attribute sets. Role inheritance is roles
which inherit permissions from other roles. So a Senior Loan Administrator
is a Loan Administrator, with a few more permissions. But someone who is a
Senior Loan Administrator is not necessarily a Loan Administrator.

I copied the test case mentioned below, and search and replaced stuff, and it
works fine with Role Inheritance. Here is the equivalent API to that
mentioned below for attribute sets. (note: this.top is a folder)

Role orgA = this.top.addChildRole("orgA", "orgA");

Role orgB = this.top.addChildRole("orgB", "orgB");

roleSetViewCount = HibernateSession.bySqlStatic().select(
int.class, "select count(1) from grouper_role_set_v");

assertEquals(initialRoleSetViewCount + 2, roleSetViewCount);

// A -> B
assertTrue(orgA.addToRoleSet(orgB));

roleSetViewCount = HibernateSession.bySqlStatic().select(
int.class, "select count(1) from grouper_role_set_v");

assertEquals(initialRoleSetViewCount + 3, roleSetViewCount);

//...snip...
//test the relationship:

assertEquals("top:orgA", roleSetViews.get(index)
.getIfHasRoleName());
assertEquals("top:orgB", roleSetViews.get(index)
.getThenHasRoleName());
assertEquals(1, roleSetViews.get(index).getDepth());
assertEquals(RoleHierarchyType.immediate, roleSetViews
.get(index).getType());
assertEquals("top:orgA", roleSetViews.get(index).getParentIfHasName());
assertEquals("top:orgA", roleSetViews.get(index).getParentThenHasName());

Chris

> -----Original Message-----
> From: Chris Hyzer
> Sent: Wednesday, September 16, 2009 5:05 AM
> To: 'Tom Barton';
>
> Subject: RE: [grouper-dev] Grouper design call, Wednesday, 16 September
> 2009, 1200EDT (1600Z)
>
>
> > 5. Chris' hierarchical needs
>
> I don't think I have needs, just giving progress update. I have
> mentioned the three directed graphs in grouper known as *sets: groups
> as members of groups (groupSets), attributes in sets (attributeSets),
> and "hierarchical" roles (roleSets). Shilen has the groupSets
> implemented, and I have the attributeSets implemented, and tested with
> a complex setup (probably more complex that someone would actually
> implement).
>
> I add each relationship in the pic below, and can remove any of the
> relationships, and still have an intact data model. Now that it is the
> GrouperSet interface (and GrouperSetElement and GrouperSetEnum), I hope
> to add the "hierarchical" roles without much trouble.
>
> Granted, there is a lot of duplication, and copy/paste, but the test
> case is 14k lines...
>
> * complex relationships: ^ means relationship pointing up, v means
> down -> means right
> * e.g. if someone has A, then that someone also effectively has B.
> * So B is in the attributeSet of A,
> * as is C, D, E, F, G, H, I, J, and L (not K)
> *
> * K G---\
> * \ ^ \
> * \ / \
> * v / \
> * C L \
> * ^ \ ^ |
> * / \ / |
> * / v / v
> * A -----> B E ----> F
> * |\ \ ^ ^
> * | \ \ / /
> * | \ v / /
> * | \ D J
> * | \ ^|
> * | \ / |
> * v v / |
> * H----> I --------/ |
> * ^ /
> * \ /
> * \--------------/
> *
> *
> * So the immediate relationships are:
> * A -> B
> * A -> H
> * A -> I
> * B -> C
> * B -> D
> * C -> E
> * C -> G
> * D -> E
> * E -> F
> * E -> L
> * G -> F
> * H -> I
> * I -> J
> * J -> H
> * J -> F
> * K -> C
>
> If anyone cares about the API, here is an example (this.top is a stem):
>
> AttributeDef attributeDef = this.top.addChildAttributeDef("orgs",
> AttributeDefType.attr);
> AttributeDefName orgA =
> this.top.addChildAttributeDefName(attributeDef, "orgA",
> "orgA");
> AttributeDefName orgB =
> this.top.addChildAttributeDefName(attributeDef, "orgB",
> "orgB");
>
> // A -> B
> assertTrue(orgA.addToAttributeDefNameSet(orgB));
>
> attrDefNameSetViewCount = HibernateSession.bySqlStatic().select(
> int.class, "select count(1) from grouper_attr_def_name_set_v");
>
> assertEquals(initialAttrDefNameSetViewCount + 3,
> attrDefNameSetViewCount);
>
> //...snip...
> //test the relationship:
>
> assertEquals("top:orgA", attributeDefNameSetViews.get(index)
> .getIfHasAttrDefNameName());
> assertEquals("top:orgB", attributeDefNameSetViews.get(index)
> .getThenHasAttrDefNameName());
> assertEquals(1, attributeDefNameSetViews.get(index).getDepth());
> assertEquals(AttributeDefAssignmentType.immediate,
> attributeDefNameSetViews
> .get(index).getType());
> assertEquals("top:orgA",
> attributeDefNameSetViews.get(index).getParentIfHasName());
> assertEquals("top:orgA",
> attributeDefNameSetViews.get(index).getParentThenHasName());



Archive powered by MHonArc 2.6.16.

Top of Page