public static IEnumerable <Guid> GetNodesWithRightIncludingGroups(this IPermissionStore permissionStore, Guid subjectID, string spec) { return(permissionStore.GetNodesWithRight(subjectID, spec).Union( permissionStore.GetGroups(subjectID).SelectMany(groupID => permissionStore.GetNodesWithRight(groupID, spec)))); }
public static bool HasRightIncludingGroups(this IPermissionStore permissionStore, Guid nodeID, Guid subjectID, string spec) { return(permissionStore.HasRight(nodeID, subjectID, spec) || permissionStore.GetGroups(subjectID) .Any(groupID => permissionStore.HasRight(nodeID, groupID, spec))); }