Package org.opencms.db
Class CmsDefaultUsers
java.lang.Object
org.opencms.db.CmsDefaultUsers
Provides access to the names of the OpenCms default users and groups.
- Since:
- 6.0.0
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
Default name for the "Administrators" group.protected static final String
Default name for the "Guests" group.protected static final String
Default name for the "Users" group.protected static final String
Default name for the "Admin" user.protected static final String
Default name for the "Deleted Resource" user.protected static final String
Default name for the "Export" user.protected static final String
Default name for the "Guest" user. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the name of the administrators group.Returns the name of the guests group.Deprecated.As of OpenCms 9.5, there is no default group for project managers anymore.Returns the name of the users group.Returns the name of the default administrator user.Returns the name of the default deleted resource user.Returns the name of the user used to generate the static export.Returns the name of the default guest user.protected void
init
(String userAdmin, String userGuest, String userExport, String userDeletedResource, String groupAdministrators, String groupUsers, String groupGuests) Initializes this instance.boolean
isDefaultGroup
(String groupName) Checks if a given group name is the name of one of the OpenCms default groups.boolean
isDefaultUser
(String userName) Checks if a given user name is the name of one of the OpenCms default users.boolean
isGroupGuests
(String groupName) Checks if a given group name is the name of the guests group.boolean
isUserAdmin
(String userName) Checks if a given user name is the name of the admin user.boolean
isUserExport
(String userName) Checks if a given user name is the name of the export user.boolean
isUserGuest
(String userName) Checks if a given user name is the name of the guest user.
-
Field Details
-
DEFAULT_GROUP_ADMINISTRATORS
Default name for the "Administrators" group.- See Also:
-
DEFAULT_GROUP_GUESTS
Default name for the "Guests" group.- See Also:
-
DEFAULT_GROUP_USERS
Default name for the "Users" group.- See Also:
-
DEFAULT_USER_ADMIN
Default name for the "Admin" user.- See Also:
-
DEFAULT_USER_DELETED_RESOURCE
Default name for the "Deleted Resource" user.- See Also:
-
DEFAULT_USER_EXPORT
Default name for the "Export" user.- See Also:
-
DEFAULT_USER_GUEST
Default name for the "Guest" user.- See Also:
-
-
Constructor Details
-
CmsDefaultUsers
public CmsDefaultUsers()Constructor that initializes all names with default values.See the constants of this class for the defaule values that are uses.
-
CmsDefaultUsers
public CmsDefaultUsers(String userAdmin, String userGuest, String userExport, String userDeletedResource, String groupAdministrators, String groupUsers, String groupGuests) Public constructor.- Parameters:
userAdmin
- the name of the default admin useruserGuest
- the name of the guest useruserExport
- the name of the export useruserDeletedResource
- the name of the deleted resource user, can benull
groupAdministrators
- the name of the administrators groupgroupUsers
- the name of the users groupgroupGuests
- the name of the guests group
-
-
Method Details
-
getGroupAdministrators
Returns the name of the administrators group.- Returns:
- the name of the administrators group
-
getGroupGuests
Returns the name of the guests group.- Returns:
- the name of the guests group
-
getGroupProjectmanagers
Deprecated.As of OpenCms 9.5, there is no default group for project managers anymore. Use the roleCmsRole.PROJECT_MANAGER
instead in case you want a user to be able to manage projects. For backward compatibility in old installations, this returns the old default group name "Projectmanagers".Returns the name of the project managers group.- Returns:
- the name of the project managers group
-
getGroupUsers
Returns the name of the users group.- Returns:
- the name of the users group
-
getUserAdmin
Returns the name of the default administrator user.- Returns:
- the name of the default administrator user
-
getUserDeletedResource
Returns the name of the default deleted resource user.- Returns:
- the name of the default deleted resource user
-
getUserExport
Returns the name of the user used to generate the static export.- Returns:
- the name of the user used to generate the static export
-
getUserGuest
Returns the name of the default guest user.- Returns:
- the name of the default guest user
-
isDefaultGroup
Checks if a given group name is the name of one of the OpenCms default groups.- Parameters:
groupName
- the group name to check- Returns:
true
if group name is one of OpenCms default groups,false
if it is not or ifgroupName
isnull
or an empty string (no trim)- See Also:
-
isDefaultUser
Checks if a given user name is the name of one of the OpenCms default users.- Parameters:
userName
- the group name to check- Returns:
true
if user name is one of OpenCms default users,false
if it is not or ifuserName
isnull
or an empty string (no trim)- See Also:
-
isGroupGuests
Checks if a given group name is the name of the guests group.- Parameters:
groupName
- the group name to check- Returns:
true
if a given group name is the name of the guests group
-
isUserAdmin
Checks if a given user name is the name of the admin user.- Parameters:
userName
- the user name to check- Returns:
true
if a given user name is the name of the admin user
-
isUserExport
Checks if a given user name is the name of the export user.- Parameters:
userName
- the user name to check- Returns:
true
if a given user name is the name of the export user
-
isUserGuest
Checks if a given user name is the name of the guest user.- Parameters:
userName
- the user name to check- Returns:
true
if a given user name is the name of the guest user
-
init
protected void init(String userAdmin, String userGuest, String userExport, String userDeletedResource, String groupAdministrators, String groupUsers, String groupGuests) Initializes this instance.- Parameters:
userAdmin
- the name of the default admin useruserGuest
- the name of the guest useruserExport
- the name of the export useruserDeletedResource
- the name of the deleted resource user, can benull
groupAdministrators
- the name of the administrators groupgroupUsers
- the name of the users groupgroupGuests
- the name of the guests group
-