I think I've found a bug with the JSAPI call getRoles. We use it to get all the assets in the instance that are assigned to an individual user based on a single role. We used to apply roles individually, but lately we've been assigning user groups to some parts of the site so we can easily adjust roles assignment without having to constantly cascade.
When calling getRoles() from the JSAPI I've hit a snag. Individually assigned roles are still fine, but roles assigned to groups are not. If the user is in more than one user group, getRoles() doesn't expand all the user groups, only one of them (seemingly at random). This is the syntax of the call:
var include_assetid = true; var include_globals = false; var expand_groups = true; var inc_dependants = false; var include_parents = true; var strict_type_code = true;getRoles(’’, roleID, userID, include_assetid, include_globals, expand_groups, inc_dependants, include_parents, typeCodes, strict_type_code, function(data) {
… do some stuff …
}); // getRoles
I'm using Firebug to check the JSON responses. Variables roleID, userID, and typeCodes are already defined.
Structure of sites is as follows:
User Group A User Group BSite A
|- Page
|- Page
|- Page
…Site B
|- Page
|- Page
|- Page
…
User Group A is assigned to a role for all pages in Site A, and User Group B all pages for Site B. The role is the same for both sites.
- If I put a user into Group A, getRoles returns fine. Gives me a list of all pages in Site A.
- If I move user to Group B, so they are only in one group, also fine. Gives me a list of all pages in Site B.
- If I link User under both groups (ie Group A and Group B this is where I have the issue. I'm expecting to receive a list of all pages in both Site A and Site B, but I'm not. I only get pages for Site B.
I don't think it's a syntax or similar error since it works for cases 1 and 2 above. There's a similar function available for the WebServices package and wondering if it's plagued by the same issue.
Matrix v4.12. Users are primarily LDAP accounts.
Cheers