/** * Copyright 2020 Inrupt Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the * Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ import { unstable_AclDataset, unstable_Acl } from "./interfaces"; /** * Verify whether an ACL was found for the given LitDataset. * * A LitDataset fetched with [[unstable_fetchLitDatasetWithAcl]] _might_ have an ACL attached, but * we cannot be sure: it might be that none exists for this specific Resource (in which case the * fallback ACL applies), or the currently authenticated user (if any) might not have Control access * to the fetched Resource. * * This function verifies that the LitDataset's ACL is accessible. * * @param dataset A [[LitDataset]] that might have an ACL attached. * @returns Whether `dataset` has an ACL attached. */ export declare function unstable_hasResourceAcl(dataset: Dataset): dataset is Dataset & { acl: { resourceAcl: Exclude; }; }; /** * Access the ACL attached to a LitDataset. * * Given a LitDataset that has an ACL attached, this function will give you access to that ACL. To * verify whether the ACL is available, see [[unstable_hasResourceAcl]]. * * @param dataset A [[LitDataset]] with potentially an ACL attached. * @returns The ACL, if available, and undefined if not. */ export declare function unstable_getResourceAcl(dataset: unstable_Acl & { acl: { resourceAcl: Exclude; }; }): unstable_AclDataset; export declare function unstable_getResourceAcl(dataset: unstable_Acl): unstable_AclDataset | null; /** * Verify whether a fallback ACL was found for the given LitDataset. * * A LitDataset fetched with [[unstable_fetchLitDatasetWithAcl]] _might_ have a fallback ACL * attached, but we cannot be sure: the currently authenticated user (if any) might not have Control * access to one of the fetched Resource's Containers. * * This function verifies that the fallback ACL is accessible. * * @param dataset A [[LitDataset]] that might have a fallback ACL attached. * @returns Whether `dataset` has a fallback ACL attached. */ export declare function unstable_hasFallbackAcl(dataset: Dataset): dataset is Dataset & { acl: { fallbackAcl: Exclude; }; }; /** * Access the fallback ACL attached to a LitDataset. * * Given a LitDataset that has a fallback ACL attached, this function will give you access to that * ACL. To verify whether the fallback ACL is available, see [[unstable_hasFallbackAcl]]. * * @param dataset A [[LitDataset]] with potentially a fallback ACL attached. * @returns The fallback ACL, or null if it coult not be accessed. */ export declare function unstable_getFallbackAcl(dataset: unstable_Acl & { acl: { fallbackAcl: Exclude; }; }): unstable_AclDataset; export declare function unstable_getFallbackAcl(dataset: unstable_Acl): unstable_AclDataset | null;