I finally got back to working on #431454: Integrate with autoassignrole module, but found autoassignrole_get_roles() to be broken (it spits out query errors and such), and not sure how its useful for the integration.

What I need is a function that gives me the current role the user will be given based on the current state of things.

As in if they are on a path based assignment and I call autoassignrole_get_role() then it would decode that and give me the role they we be getting, vs is they happen to be selecting it etc.

Thanks.

CommentFileSizeAuthor
#2 autoassignrole-688934.patch7.32 KBcyberswat

Comments

cyberswat’s picture

Assigned: Unassigned » cyberswat
cyberswat’s picture

Status: Active » Needs review
StatusFileSize
new7.32 KB

I added a new $op to autoassignrole_get_role() called 'active' which I think will do what your looking for. I also broke each of the functions in autoassignrole_get_role() out to their own functions. After applying the patch against dev, you can either call autoassignrole_get_role('active') or autoassignrole_get_active_path_roles() and it should give you what your looking for. You can pass an array of paths to either of these functions to get the roles that would be assigned for those path(s) while not passing an array should return them based on the current active path.

Let me know if this gives you what your looking for.

cyberswat’s picture

Status: Needs review » Needs work

I'm going to switch status on this to see if the automated testing will kick in

cyberswat’s picture

Status: Needs work » Needs review
boombatower’s picture

Just making a comment will trigger it to evaluate the patches.

kewlguy’s picture

#2: autoassignrole-688934.patch queued for re-testing.

cyberswat’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.