"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.hasOrgAdminViewRights = hasOrgAdminViewRights;
exports.hasOrgAdminUpdateRights = hasOrgAdminUpdateRights;
exports.hasOrgAdminDeleteRights = hasOrgAdminDeleteRights;
const platform_1 = require("./platform");
/**
 * @internal
 * @hidden
 */
function hasOrgAdminViewRights(user = {}, orgId) {
    return ((0, platform_1.isOrgAdminInOrg)(user, orgId) ||
        ((0, platform_1.isUserInOrg)(user, orgId) &&
            (0, platform_1.userHasPrivileges)(user, ["portal:admin:viewItems"])));
}
/**
 * @internal
 * @hidden
 */
function hasOrgAdminUpdateRights(user = {}, orgId) {
    return ((0, platform_1.isOrgAdminInOrg)(user, orgId) ||
        ((0, platform_1.isUserInOrg)(user, orgId) &&
            (0, platform_1.userHasPrivileges)(user, [
                "portal:admin:viewItems",
                "portal:admin:updateItems",
            ])));
}
/**
 * @internal
 * @hidden
 */
function hasOrgAdminDeleteRights(user = {}, orgId) {
    return ((0, platform_1.isOrgAdminInOrg)(user, orgId) ||
        ((0, platform_1.isUserInOrg)(user, orgId) &&
            (0, platform_1.userHasPrivileges)(user, [
                "portal:admin:viewItems",
                "portal:admin:deleteItems",
            ])));
}
//# sourceMappingURL=portal-privilege.js.map