Class CmsDefaultUsers

java.lang.Object
org.opencms.db.CmsDefaultUsers

public class CmsDefaultUsers extends Object
Provides access to the names of the OpenCms default users and groups.

Since:
6.0.0
  • Field Details

  • 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 user
      userGuest - the name of the guest user
      userExport - the name of the export user
      userDeletedResource - the name of the deleted resource user, can be null
      groupAdministrators - the name of the administrators group
      groupUsers - the name of the users group
      groupGuests - 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 role CmsRole.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

      public String 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

      public String getUserGuest()
      Returns the name of the default guest user.

      Returns:
      the name of the default guest user
    • isDefaultGroup

      public boolean isDefaultGroup(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 if groupName is null or an empty string (no trim)
      See Also:
    • isDefaultUser

      public boolean isDefaultUser(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 if userName is null or an empty string (no trim)
      See Also:
    • isGroupGuests

      public boolean isGroupGuests(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(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(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(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(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 user
      userGuest - the name of the guest user
      userExport - the name of the export user
      userDeletedResource - the name of the deleted resource user, can be null
      groupAdministrators - the name of the administrators group
      groupUsers - the name of the users group
      groupGuests - the name of the guests group