/** * This file is auto generated from JavaDoc. Do not modify it manually. */ import type { Node } from "../../types/javax/jcr/Node"; /** * System user utility interface. * *

* This interface handles nodes with primary node type sv:systemUser, i.e. the * Anonymous, System, Indexer, Validator and Extractor user. *

* *

* An instance of the Sitevision class implementing this interface can be obtained via * {@link senselogic.sitevision.api.user.UserFactory#getSystemUserUtil()}. * See {@link senselogic.sitevision.api.user.UserFactory} for how to obtain an instance of the UserFactory interface. *

* @author Magnus Lövgren * @since Sitevision 3.6 */ export interface SystemUserUtil { /** * Checks if current user is any system user (Anonymous, System, Indexer, Validator, Extractor). * *

* This is a convenience method that is much more efficient than checking for each system user type instance separately. *

*

* Javascript code that uses SystemUserUtil like this: *

const isLoggedInHuman = () => {
   *    return (
   *      !systemUserUtil.isAnonymous() &&
   *      !systemUserUtil.isSystem() &&
   *      !systemUserUtil.isIndexer() &&
   *      !systemUserUtil.isValidator() &&
   *      !systemUserUtil.isExtractor()
   *    );
   *  };

* Should be replaced with code that uses this method instead: *

const isLoggedInHuman = () => {
   *    return !systemUserUtil.isAnySystemUser();
   *  };
* *

* Note! This method does NOT produce a reliable result if called during the authentication process * (i.e. from a JAAS filter or JAAS module) since it relies on a fully loaded current user (as of * {@link senselogic.sitevision.api.context.PortletContextUtil#getCurrentUser()}). *

* @return returns true if the current user is any system user (Anonymous, System, Indexer, Validator, Extractor), false otherwise * @see #isAnySystemUser(Node) * @since Sitevision 2024.10.1 */ isAnySystemUser(): boolean; /** * Checks if a user node is any system user (Anonymous, System, Validator, Indexer, Extractor). * *

* This is a convenience method that checks if a given user node is any system user * (Anonymous, System, Validator, Indexer, Extractor). Note that method is equivalent to checking the node type * via {@link senselogic.sitevision.api.node.NodeTypeUtil#isSystemUser(Node) NodeTypeUtil.isSystemUser(aUserNode)}. *

* @param aUserNode a user node * @return returns true if aUserNode is any system user (Anonymous, System, Validator, Indexer, Extractor), false otherwise * @see senselogic.sitevision.api.node.NodeTypeUtil#isSystemUser(Node) * @since Sitevision 2024.10.1 */ isAnySystemUser(aUserNode: Node): boolean; /** * Checks if current user is anonymous (not authenticated). * *

* An Anonymous user is not authenticated and can only access public resources. *

* *

* Note! This method does NOT produce a reliable result if called during the authentication process * (i.e. from a JAAS filter or JAAS module) since it relies on a fully loaded current user (as of * {@link senselogic.sitevision.api.context.PortletContextUtil#getCurrentUser()}). *

* @return true if current user is Anonymous (i.e. not authenticated), false otherwise */ isAnonymous(): boolean; /** * Checks if a user node is anonymous (not authenticated). * *

* An Anonymous user is not authenticated and can only access public resources. *

* @param aUserNode a user node * @return true if aUserNode is anonymous (i.e. not authenticated), false otherwise (i.e. no match or aUserNode is null) */ isAnonymous(aUserNode: Node): boolean; /** * Checks if current user is the Sitevision System user. * *

* The System user has all permissions and full access to all Sitevision portlets and functionality allowed * by the current license(-s). *

* *

* Note! This method does NOT produce a reliable result if called during the authentication process * (i.e. from a JAAS filter or JAAS module) since it relies on a fully loaded current user (as of * {@link senselogic.sitevision.api.context.PortletContextUtil#getCurrentUser()}). *

* @return true if current user is the Sitevision System user, false otherwise */ isSystem(): boolean; /** * Checks if a user node is the Sitevision System user. * *

* The System user has all permissions and full access to all Sitevision portlets and functionality allowed * by the current license(-s). *

* @param aUserNode a user node * @return true if aUserNode is the Sitevision System user, false otherwise (i.e. no match or aUserNode is null) */ isSystem(aUserNode: Node): boolean; /** * Checks if current user is the Sitevision Indexer. * *

* The Indexer user has read permission on all resources and visits/renders pages in order to collect * metadata/content and such that should be indexed by the Sitevision search engine. *

* *

* Note! This method does NOT produce a reliable result if called during the authentication process * (i.e. from a JAAS filter or JAAS module) since it relies on a fully loaded current user (as of * {@link senselogic.sitevision.api.context.PortletContextUtil#getCurrentUser()}). *

* @return true if current user is the Sitevision Indexer, false otherwise */ isIndexer(): boolean; /** * Checks if a user node is the Sitevision Indexer. * *

* The Indexer user has read permission on all resources and visits/renders pages in order to collect * metadata/content and such that should be indexed by the Sitevision search engine. *

* @param aUserNode a user node * @return true if aUserNode is the Sitevision Indexer, false otherwise (i.e. no match or aUserNode is null) */ isIndexer(aUserNode: Node): boolean; /** * Checks if current user is the Sitevision Validator. * *

* The Validator user has read permission on all resources and visits/renders pages in order to validate them. *

* *

* Note! This method does NOT produce a reliable result if called during the authentication process * (i.e. from a JAAS filter or JAAS module) since it relies on a fully loaded current user (as of * {@link senselogic.sitevision.api.context.PortletContextUtil#getCurrentUser()}). *

* @return true if current user is the Sitevision Validator, false otherwise * @since Sitevision 4.2.3 */ isValidator(): boolean; /** * Checks if a user node is the Sitevision Validator. * *

* The Validator user has read permission on all resources and visits/renders pages in order to validate them. *

* @param aUserNode a user node * @return true if aUserNode is the Sitevision Validator, false otherwise (i.e. no match or aUserNode is null) * @since Sitevision 4.2.3 */ isValidator(aUserNode: Node): boolean; /** * Checks if current user is the Sitevision Extractor. * *

* The Extractor user has read permission on all resources and renders pages in order to store their * content as static html pages. *

* *

* Note! This method does NOT produce a reliable result if called during the authentication process * (i.e. from a JAAS filter or JAAS module) since it relies on a fully loaded current user (as of * {@link senselogic.sitevision.api.context.PortletContextUtil#getCurrentUser()}). *

* @return true if current user is the Sitevision Extractor, false otherwise */ isExtractor(): boolean; /** * Checks if a user node is the Sitevision Extractor. * *

* The Extractor user has read permission on all resources and renders pages in order to store their * content as static html pages. *

* @param aUserNode a user node * @return true if aUserNode is the Sitevision Extractor, false otherwise (i.e. no match or aUserNode is null) */ isExtractor(aUserNode: Node): boolean; } declare namespace SystemUserUtil {} declare var systemUserUtil: SystemUserUtil; export default systemUserUtil;