Package org.opencms.db
Class CmsDefaultUsers
- java.lang.Object
-
- org.opencms.db.CmsDefaultUsers
-
public class CmsDefaultUsers extends java.lang.Object
Provides access to the names of the OpenCms default users and groups.- Since:
- 6.0.0
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
DEFAULT_GROUP_ADMINISTRATORS
Default name for the "Administrators" group.protected static java.lang.String
DEFAULT_GROUP_GUESTS
Default name for the "Guests" group.protected static java.lang.String
DEFAULT_GROUP_USERS
Default name for the "Users" group.protected static java.lang.String
DEFAULT_USER_ADMIN
Default name for the "Admin" user.protected static java.lang.String
DEFAULT_USER_DELETED_RESOURCE
Default name for the "Deleted Resource" user.protected static java.lang.String
DEFAULT_USER_EXPORT
Default name for the "Export" user.protected static java.lang.String
DEFAULT_USER_GUEST
Default name for the "Guest" user.
-
Constructor Summary
Constructors Constructor Description CmsDefaultUsers()
Constructor that initializes all names with default values.CmsDefaultUsers(java.lang.String userAdmin, java.lang.String userGuest, java.lang.String userExport, java.lang.String userDeletedResource, java.lang.String groupAdministrators, java.lang.String groupUsers, java.lang.String groupGuests)
Public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.String
getGroupAdministrators()
Returns the name of the administrators group.java.lang.String
getGroupGuests()
Returns the name of the guests group.java.lang.String
getGroupProjectmanagers()
Deprecated.As of OpenCms 9.5, there is no default group for project managers anymore.java.lang.String
getGroupUsers()
Returns the name of the users group.java.lang.String
getUserAdmin()
Returns the name of the default administrator user.java.lang.String
getUserDeletedResource()
Returns the name of the default deleted resource user.java.lang.String
getUserExport()
Returns the name of the user used to generate the static export.java.lang.String
getUserGuest()
Returns the name of the default guest user.protected void
init(java.lang.String userAdmin, java.lang.String userGuest, java.lang.String userExport, java.lang.String userDeletedResource, java.lang.String groupAdministrators, java.lang.String groupUsers, java.lang.String groupGuests)
Initializes this instance.boolean
isDefaultGroup(java.lang.String groupName)
Checks if a given group name is the name of one of the OpenCms default groups.boolean
isDefaultUser(java.lang.String userName)
Checks if a given user name is the name of one of the OpenCms default users.boolean
isGroupGuests(java.lang.String groupName)
Checks if a given group name is the name of the guests group.boolean
isUserAdmin(java.lang.String userName)
Checks if a given user name is the name of the admin user.boolean
isUserExport(java.lang.String userName)
Checks if a given user name is the name of the export user.boolean
isUserGuest(java.lang.String userName)
Checks if a given user name is the name of the guest user.
-
-
-
Field Detail
-
DEFAULT_GROUP_ADMINISTRATORS
protected static final java.lang.String DEFAULT_GROUP_ADMINISTRATORS
Default name for the "Administrators" group.- See Also:
- Constant Field Values
-
DEFAULT_GROUP_GUESTS
protected static final java.lang.String DEFAULT_GROUP_GUESTS
Default name for the "Guests" group.- See Also:
- Constant Field Values
-
DEFAULT_GROUP_USERS
protected static final java.lang.String DEFAULT_GROUP_USERS
Default name for the "Users" group.- See Also:
- Constant Field Values
-
DEFAULT_USER_ADMIN
protected static final java.lang.String DEFAULT_USER_ADMIN
Default name for the "Admin" user.- See Also:
- Constant Field Values
-
DEFAULT_USER_DELETED_RESOURCE
protected static final java.lang.String DEFAULT_USER_DELETED_RESOURCE
Default name for the "Deleted Resource" user.- See Also:
- Constant Field Values
-
DEFAULT_USER_EXPORT
protected static final java.lang.String DEFAULT_USER_EXPORT
Default name for the "Export" user.- See Also:
- Constant Field Values
-
DEFAULT_USER_GUEST
protected static final java.lang.String DEFAULT_USER_GUEST
Default name for the "Guest" user.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
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(java.lang.String userAdmin, java.lang.String userGuest, java.lang.String userExport, java.lang.String userDeletedResource, java.lang.String groupAdministrators, java.lang.String groupUsers, java.lang.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 Detail
-
getGroupAdministrators
public java.lang.String getGroupAdministrators()
Returns the name of the administrators group.- Returns:
- the name of the administrators group
-
getGroupGuests
public java.lang.String getGroupGuests()
Returns the name of the guests group.- Returns:
- the name of the guests group
-
getGroupProjectmanagers
@Deprecated public java.lang.String 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
public java.lang.String getGroupUsers()
Returns the name of the users group.- Returns:
- the name of the users group
-
getUserAdmin
public java.lang.String getUserAdmin()
Returns the name of the default administrator user.- Returns:
- the name of the default administrator user
-
getUserDeletedResource
public java.lang.String getUserDeletedResource()
Returns the name of the default deleted resource user.- Returns:
- the name of the default deleted resource user
-
getUserExport
public java.lang.String 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
public java.lang.String getUserGuest()
Returns the name of the default guest user.- Returns:
- the name of the default guest user
-
isDefaultGroup
public boolean isDefaultGroup(java.lang.String groupName)
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:
getGroupAdministrators()
,getGroupUsers()
,getGroupGuests()
-
isDefaultUser
public boolean isDefaultUser(java.lang.String userName)
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:
getUserAdmin()
,getUserExport()
,getUserGuest()
,getUserDeletedResource()
-
isGroupGuests
public boolean isGroupGuests(java.lang.String groupName)
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
public boolean isUserAdmin(java.lang.String userName)
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
public boolean isUserExport(java.lang.String userName)
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
public boolean isUserGuest(java.lang.String userName)
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(java.lang.String userAdmin, java.lang.String userGuest, java.lang.String userExport, java.lang.String userDeletedResource, java.lang.String groupAdministrators, java.lang.String groupUsers, java.lang.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
-
-