synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
18 lines • 1.08 kB
TypeScript
import { ResourceAccess, UserGroupHeader } from '@sage-bionetworks/synapse-types';
/**
* Utility type to combine a ResourceAccess and the associated UserGroupHeader for that principalId.
* This allows us to easily sort the ResourceAccess list by the name of the user or team.
*/
export type ResourceAccessAndUserGroupHeader = {
resourceAccess: ResourceAccess;
userGroupHeader: UserGroupHeader;
};
/**
* Comparator for ResourceAccess list. Sorts by the following criteria:
* 1. Users or teams with the CHANGE_PERMISSIONS permission should be at the top, sorted alphabetically by username
* 2. The authenticated group (all users signed in to Synapse)
* 3. The public group (all users signed in to Synapse, and 'anonymous')
* 4. All other users or teams, sorted alphabetically by username
*/
export declare function compareResourceAccessAndUserGroupHeader(a: ResourceAccessAndUserGroupHeader, b: ResourceAccessAndUserGroupHeader, authenticatedPrincipalId?: string, publicPrincipalId?: string): number;
//# sourceMappingURL=ResourceAccessAndUserGroupHeader.d.ts.map