Copyright© 2008-2024 Sitevision AB, all rights reserved.
@Requireable(value="SystemUserUtil") public interface SystemUserUtil
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
UserFactory.getSystemUserUtil().
See UserFactory for how to obtain an instance of the UserFactory interface.
| Modifier and Type | Method and Description |
|---|---|
boolean |
isAnonymous()
Checks if current user is anonymous (not authenticated).
|
boolean |
isAnonymous(Node aUserNode)
Checks if a user node is anonymous (not authenticated).
|
boolean |
isAnySystemUser()
Checks if current user is any system user (Anonymous, System, Indexer, Validator, Extractor).
|
boolean |
isAnySystemUser(Node aUserNode)
Checks if a user node is any system user (Anonymous, System, Validator, Indexer, Extractor).
|
boolean |
isExtractor()
Checks if current user is the Sitevision Extractor.
|
boolean |
isExtractor(Node aUserNode)
Checks if a user node is the Sitevision Extractor.
|
boolean |
isIndexer()
Checks if current user is the Sitevision Indexer.
|
boolean |
isIndexer(Node aUserNode)
Checks if a user node is the Sitevision Indexer.
|
boolean |
isSystem()
Checks if current user is the Sitevision System user.
|
boolean |
isSystem(Node aUserNode)
Checks if a user node is the Sitevision System user.
|
boolean |
isValidator()
Checks if current user is the Sitevision Validator.
|
boolean |
isValidator(Node aUserNode)
Checks if a user node is the Sitevision Validator.
|
boolean isAnySystemUser()
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
PortletContextUtil.getCurrentUser()).
isAnySystemUser(Node)boolean isAnySystemUser(Node aUserNode)
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 NodeTypeUtil.isSystemUser(aUserNode).
aUserNode - a user nodeNodeTypeUtil.isSystemUser(Node)boolean isAnonymous()
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
PortletContextUtil.getCurrentUser()).
true if current user is Anonymous (i.e. not authenticated), false otherwiseboolean isAnonymous(Node aUserNode)
An Anonymous user is not authenticated and can only access public resources.
aUserNode - a user nodetrue if aUserNode is anonymous (i.e. not authenticated), false otherwise
(i.e. no match or aUserNode is null)boolean isSystem()
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
PortletContextUtil.getCurrentUser()).
true if current user is the Sitevision System user, false otherwiseboolean isSystem(Node aUserNode)
The System user has all permissions and full access to all Sitevision portlets and functionality allowed by the current license(-s).
aUserNode - a user nodetrue if aUserNode is the Sitevision System user, false otherwise
(i.e. no match or aUserNode is null)boolean isIndexer()
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
PortletContextUtil.getCurrentUser()).
true if current user is the Sitevision Indexer, false otherwiseboolean isIndexer(Node aUserNode)
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.
aUserNode - a user nodetrue if aUserNode is the Sitevision Indexer, false otherwise
(i.e. no match or aUserNode is null)boolean isValidator()
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
PortletContextUtil.getCurrentUser()).
true if current user is the Sitevision Validator, false otherwiseboolean isValidator(Node aUserNode)
The Validator user has read permission on all resources and visits/renders pages in order to validate them.
aUserNode - a user nodetrue if aUserNode is the Sitevision Validator, false otherwise
(i.e. no match or aUserNode is null)boolean isExtractor()
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
PortletContextUtil.getCurrentUser()).
true if current user is the Sitevision Extractor, false otherwiseboolean isExtractor(Node aUserNode)
The Extractor user has read permission on all resources and renders pages in order to store their content as static html pages.
aUserNode - a user nodetrue if aUserNode is the Sitevision Extractor, false otherwise
(i.e. no match or aUserNode is null)Sitevision - Portal and Content Management Made Easy
Sitevision is an advanced Java enterprise portal product and a portlet container (JSR 286) that implements Java Content Repository (JSR 283).
Copyright© 2008-2024 Sitevision AB, all rights reserved.