page-grant.ts 733 B

123456789101112131415161718192021222324252627
  1. import { PageGrant } from './page';
  2. export type IDataApplicableGroup = {
  3. applicableGroups?: {_id: string, name: string}[] // TODO: Typescriptize model
  4. }
  5. export type IDataApplicableGrant = null | IDataApplicableGroup;
  6. export type IRecordApplicableGrant = Record<PageGrant, IDataApplicableGrant>
  7. export type IResApplicableGrant = {
  8. data?: IRecordApplicableGrant
  9. }
  10. export type IPageGrantData = {
  11. grant: number,
  12. grantedGroup?: {
  13. id: string,
  14. name: string
  15. }
  16. }
  17. export type IResIsGrantNormalizedGrantData = {
  18. isForbidden: boolean,
  19. currentPageGrant: IPageGrantData,
  20. parentPageGrant?: IPageGrantData
  21. }
  22. export type IResIsGrantNormalized = {
  23. isGrantNormalized: boolean,
  24. grantData: IResIsGrantNormalizedGrantData
  25. };