import { Service } from '../../providers/service/service'; import { ViewRestriction } from '../../models/restrictions'; import { Repository } from '../../models/repositories'; /** * Service for calculating view restrictions. * * Evaluates the conditions declared by the current view restriction and updates * the restriction context with the resulting restricted state. */ export declare class ViewRestrictionService implements Service { private readonly restrictionContextService; private readonly repositoryContextService; private readonly licenseContextService; private readonly securityContextService; private readonly authorizationService; private readonly conditionCheckers; /** * Recalculates whether the view is restricted based on its declared restriction conditions and repository filters. * * The view is considered restricted when at least one of its conditions is met, or the selected repository * doesn't pass its repository filters. */ recalculateIsRestricted(): void; /** * Checks whether the repository meets the view's repository type and permission requirements. * * @param repository The repository to check. * @param viewRestriction The view restriction whose filters apply. If undefined, no filters apply. * @returns `true` when the repository is of an allowed type and the user has the required permission; * otherwise, `false`. */ isRepositoryAllowed(repository: Repository, viewRestriction?: ViewRestriction): boolean; /** * Checks whether the view is restricted because the current license is invalid. * * @returns `true` when the current license is invalid; otherwise, `false`. */ private isLicenseRestricted; /** * Checks whether the view is restricted because the current user cannot write to the active repository. * * When no repository is selected, there is nothing to write to, so this condition doesn't apply. That case is covered * by {@link ViewRestrictionCondition.IS_REPOSITORY_NOT_SELECTED}. * * @returns `true` when security is enabled, a repository is selected and the user cannot write to it; otherwise, * `false`. */ private isWriteRestricted; /** * Checks whether the view is restricted because the active repository is an Ontop repository. * * @returns `true` when the active repository is Ontop; otherwise, `false`. */ private isOntopRestricted; /** * Checks whether the view is restricted because the active repository is a FedX repository. * * @returns `true` when the active repository is FedX; otherwise, `false`. */ private isFedxRestricted; /** * Checks whether the view is restricted because no repository is selected. * * @returns `true` when no repository is selected; otherwise, `false`. */ private isRepositoryNotSelectedRestricted; }