EN · DE · RU · FR · ES

#604: ProjectForgeGroup.java

projectforge-business/src/main/java/org/projectforge/business/user/ProjectForgeGroup.java Java class, projectforge-business/src/main/java/org/projectforge/business/user/ProjectForgeGroup.java 94 lines · 43 code · 41 comments · 10 blank
Purpose: Source file: projectforge/business/user/ProjectForgeGroup.java. ProjectForgeGroup.java is part of the ProjectForge open-source project management application.

Source (first 100 lines)

/////////////////////////////////////////////////////////////////////////////
//
// Project ProjectForge Community Edition
//         www.projectforge.org
//
// Copyright (C) 2001-2026 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
// This community edition is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as published
// by the Free Software Foundation; version 3 of the License.
//
// This community edition is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
// Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, see http://www.gnu.org/licenses/.
//
/////////////////////////////////////////////////////////////////////////////

package org.projectforge.business.user;

import org.projectforge.framework.persistence.user.entities.GroupDO;

/**
 * Special ProjectForge user groups, such as Administrators and Finance. Some system functionality is only available for
 * user's which are member of the required group.
 *
 * @author Kai Reinhard (k.reinhard@micromata.de)
 *
 */
public enum ProjectForgeGroup
{
  /**
   * IT system administrators of ProjectForge. They do not see all functionalities (such as finances, order book or the
   * project manager's view).
   */
  ADMIN_GROUP("PF_Admin"), //
  CONTROLLING_GROUP("PF_Controlling"), //
  FINANCE_GROUP("PF_Finance"), // Users for having full access to the companies finances.
  HR_GROUP("PF_HR"), //Users for having full access to the companies employees and salaries.
  MARKETING_GROUP("PF_Marketing"), // Marketing users can download all addresses in excel format.
  ORGA_TEAM("PF_Organization"), // Orgateam users have access to Posteingang and Postausgang.
  PROJECT_ASSISTANT("PF_ProjectAssistant"), // Users having access to the order book (for assigned orders).
  PROJECT_MANAGER("PF_ProjectManager"); //Users having access to all time sheets (without details) and order book (for assigned orders).

  private String key;

  public String getKey()
  {
    return key;
  }

  /**
   * Same as {@link #getKey()}. This is the group name.
   */
  public String getName()
  {
    return key;
  }

  public boolean matches(final String groupName)
  {
    return key.equals(groupName);
  }

  /**
   * The key will be used e. g. for i18n.
   *
   * @return
   */
  @Override
  public String toString()
  {
    return key;
  }

  ProjectForgeGroup(final String key)
  {
    this.key = key;
  }

  public static boolean isSystemGroup(GroupDO group) {
    for (ProjectForgeGroup g : ProjectForgeGroup.values()) {
      if (g.key.equals(group.getName())) {
        return true;
      }
    }
    return false;
  }
}

Git History

868d6abb7 2025 -> 2026
63081666f Source file headers: 2024-> 2025.
b6092df09 Copyright 2023 -> 2024
ab45d51fa Copyright 2001-2022 -> 2001-2023.
e6f10f987 Group filter: system groups.

868d6abb7

2025 -> 2026
868d6abb75cd191a892911ac8e45058932cf9074
diff --git a/projectforge-business/src/main/java/org/projectforge/business/user/ProjectForgeGroup.java b/projectforge-business/src/main/java/org/projectforge/business/user/ProjectForgeGroup.java
index de158ae76..e76ce988a 100644
--- a/projectforge-business/src/main/java/org/projectforge/business/user/ProjectForgeGroup.java
+++ b/projectforge-business/src/main/java/org/projectforge/business/user/ProjectForgeGroup.java
@@ -3,7 +3,7 @@
 // Project ProjectForge Community Edition
 //         www.projectforge.org
 //
-// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
+// Copyright (C) 2001-2026 Micromata GmbH, Germany (www.micromata.com)
 //
 // ProjectForge is dual-licensed.
 //

63081666f

Source file headers: 2024-> 2025.
63081666f620fb87315f01b817e560e0b2f6a33a
diff --git a/projectforge-business/src/main/java/org/projectforge/business/user/ProjectForgeGroup.java b/projectforge-business/src/main/java/org/projectforge/business/user/ProjectForgeGroup.java
index 524e13f42..de158ae76 100644
--- a/projectforge-business/src/main/java/org/projectforge/business/user/ProjectForgeGroup.java
+++ b/projectforge-business/src/main/java/org/projectforge/business/user/ProjectForgeGroup.java
@@ -3,7 +3,7 @@
 // Project ProjectForge Community Edition
 //         www.projectforge.org
 //
-// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
+// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
 //
 // ProjectForge is dual-licensed.
 //

b6092df09

Copyright 2023 -> 2024
b6092df0927c4a3b161e888445f31dcab57493f2
diff --git a/projectforge-business/src/main/java/org/projectforge/business/user/ProjectForgeGroup.java b/projectforge-business/src/main/java/org/projectforge/business/user/ProjectForgeGroup.java
index cda81bd26..524e13f42 100644
--- a/projectforge-business/src/main/java/org/projectforge/business/user/ProjectForgeGroup.java
+++ b/projectforge-business/src/main/java/org/projectforge/business/user/ProjectForgeGroup.java
@@ -3,7 +3,7 @@
 // Project ProjectForge Community Edition
 //         www.projectforge.org
 //
-// Copyright (C) 2001-2023 Micromata GmbH, Germany (www.micromata.com)
+// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
 //
 // ProjectForge is dual-licensed.
 //

ab45d51fa

Copyright 2001-2022 -> 2001-2023.
ab45d51fa419ede6174b31d69987f96d4b841ff9
diff --git a/projectforge-business/src/main/java/org/projectforge/business/user/ProjectForgeGroup.java b/projectforge-business/src/main/java/org/projectforge/business/user/ProjectForgeGroup.java
index 51b63041f..cda81bd26 100644
--- a/projectforge-business/src/main/java/org/projectforge/business/user/ProjectForgeGroup.java
+++ b/projectforge-business/src/main/java/org/projectforge/business/user/ProjectForgeGroup.java
@@ -3,7 +3,7 @@
 // Project ProjectForge Community Edition
 //         www.projectforge.org
 //
-// Copyright (C) 2001-2022 Micromata GmbH, Germany (www.micromata.com)
+// Copyright (C) 2001-2023 Micromata GmbH, Germany (www.micromata.com)
 //
 // ProjectForge is dual-licensed.
 //

e6f10f987

Group filter: system groups.
e6f10f987abac13c08a611f1f4f5ccf505a1f6d4
diff --git a/projectforge-business/src/main/java/org/projectforge/business/user/ProjectForgeGroup.java b/projectforge-business/src/main/java/org/projectforge/business/user/ProjectForgeGroup.java
index a1d136c51..51b63041f 100644
--- a/projectforge-business/src/main/java/org/projectforge/business/user/ProjectForgeGroup.java
+++ b/projectforge-business/src/main/java/org/projectforge/business/user/ProjectForgeGroup.java
@@ -23,6 +23,8 @@
 
 package org.projectforge.business.user;
 
+import org.projectforge.framework.persistence.user.entities.GroupDO;
+
 /**
  * Special ProjectForge user groups, such as Administrators and Finance. Some system functionality is only available for
  * user's which are member of the required group.
@@ -81,4 +83,12 @@ public enum ProjectForgeGroup
     this.key = key;
   }
 
+  public static boolean isSystemGroup(GroupDO group) {
+    for (ProjectForgeGroup g : ProjectForgeGroup.values()) {
+      if (g.key.equals(group.getName())) {
+        return true;
+      }
+    }
+    return false;
+  }
 }