@studyportals/sp-hs-misc
Version:
Miscellaneous code used in HouseStark's projects
55 lines (54 loc) • 2.31 kB
TypeScript
/**
* Offers the necessary functionality to query user privileges.
*
* @deprecated Use @studyportals/client-internal-platform-authorization
*/
export interface IUserPrivilegesDataHelper {
/**
* Checks whether the specified user can generate reports.
*
* @param username The username of the user whose privileges are to be checked.
*/
canGenerateReports(username: string): Promise<boolean>;
/**
* Checks whether the specified user can delete reports.
*
* @param username The username of the user whose privileges are to be checked.
*/
canDeleteReports(username: string): Promise<boolean>;
/**
* Checks whether the specified user can access the given organisation.
*
* @param username The username of the user whose privileges are to be checked.
* @param organisationId The ID of the targeted organisation.
*/
canAccessOrganisation(username: string, organisationId: string): Promise<boolean>;
/**
* Filters an array of organisation IDs, considering whether the given user has access to their data.
*
* @param username The username of the user whose privileges are to be checked.
* @param organisationIds The IDs of the targeted organisations.
*/
filterOrganisationsByUserAccess(username: string, organisationIds: string[]): Promise<string[]>;
/**
* Filters an array of campaign IDs, considering whether the given user has access to their data.
*
* @param username The username of the user whose privileges are to be checked.
* @param campaignIds The IDs of the targeted organisations.
*/
filterCampaignsByUserAccess(username: string, campaignIds: string[]): Promise<string[]>;
/**
* Checks whether the specified user can access the given campaign.
*
* @param username The username of the user whose privileges are to be checked.
* @param campaignId The ID of the targeted campaign.
*/
canAccessCampaign(username: string, campaignId: string): Promise<boolean>;
/**
* Checks whether the specified user can initiate an invalidation for the given campaign.
*
* @param username
* @param campaignId
*/
canInitiateInvalidation(username: string, campaignId: string): Promise<boolean>;
}