import { PermissionHelper, instanceOfUserTenantAccessPermission, } from "../Permission";
export default class ModelPermission {
    static hasPermissions(userProjectPermissions, modelPermissions) {
        let userPermissions = [];
        if (instanceOfUserTenantAccessPermission(userProjectPermissions) &&
            userProjectPermissions.permissions &&
            Array.isArray(userProjectPermissions.permissions)) {
            userPermissions = userProjectPermissions.permissions.map((item) => {
                return item.permission;
            });
        }
        else {
            userPermissions = userProjectPermissions;
        }
        return Boolean(userPermissions &&
            PermissionHelper.doesPermissionsIntersect(modelPermissions, userPermissions));
    }
}
//# sourceMappingURL=ModelPermission.js.map