import { UmbGuardManagerBase } from './guard.manager.base.js';
// TODO: Check the need for this one.
export class UmbReadOnlyGuardManager extends UmbGuardManagerBase {
    constructor() {
        super(...arguments);
        this.permitted = this._rules.asObservablePart((rules) => {
            return this.#resolvePermission(rules);
        });
    }
    getPermitted() {
        return this.#resolvePermission(this.getRules());
    }
    #resolvePermission(rules) {
        if (rules.filter((x) => x.permitted === false).length > 0) {
            return false;
        }
        if (rules.filter((x) => x.permitted === true).length > 0) {
            return true;
        }
        return this._fallback;
    }
}
