import { isOrgAdminInOrg, isUserInOrg, userHasPrivileges } from "./platform";
/**
 * @internal
 * @hidden
 */
export function hasOrgAdminViewRights(user = {}, orgId) {
    return (isOrgAdminInOrg(user, orgId) ||
        (isUserInOrg(user, orgId) &&
            userHasPrivileges(user, ["portal:admin:viewItems"])));
}
/**
 * @internal
 * @hidden
 */
export function hasOrgAdminUpdateRights(user = {}, orgId) {
    return (isOrgAdminInOrg(user, orgId) ||
        (isUserInOrg(user, orgId) &&
            userHasPrivileges(user, [
                "portal:admin:viewItems",
                "portal:admin:updateItems",
            ])));
}
/**
 * @internal
 * @hidden
 */
export function hasOrgAdminDeleteRights(user = {}, orgId) {
    return (isOrgAdminInOrg(user, orgId) ||
        (isUserInOrg(user, orgId) &&
            userHasPrivileges(user, [
                "portal:admin:viewItems",
                "portal:admin:deleteItems",
            ])));
}
//# sourceMappingURL=portal-privilege.js.map