예제 #1
0
 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))));
 }
예제 #2
0
 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)));
 }