diff options
Diffstat (limited to 'plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/AccessControlManager.java')
-rw-r--r-- | plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/AccessControlManager.java | 220 |
1 files changed, 110 insertions, 110 deletions
diff --git a/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/AccessControlManager.java b/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/AccessControlManager.java index 853becca3d1..628f3fc1f7a 100644 --- a/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/AccessControlManager.java +++ b/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/AccessControlManager.java @@ -1,110 +1,110 @@ -/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.osee.framework.access;
-
-import java.util.Collection;
-import java.util.logging.Level;
-import org.eclipse.osee.framework.access.internal.AccessControlService;
-import org.eclipse.osee.framework.access.internal.Activator;
-import org.eclipse.osee.framework.core.enums.PermissionEnum;
-import org.eclipse.osee.framework.core.exception.OseeAuthenticationRequiredException;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
-import org.eclipse.osee.framework.core.model.access.AccessDataQuery;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.UserManager;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-
-/**
- * Provides access control for OSEE. <REM2>
- *
- * @author Jeff C. Phillips
- */
-
-public class AccessControlManager {
-
- private AccessControlManager() {
- }
-
- public static AccessControlService getService() {
- AccessControlService accessService = Activator.getAccessControlService();
- if (accessService == null) {
- OseeLog.log(Activator.class, Level.SEVERE, "Access Service was null");
- }
- return accessService;
- }
-
- public static void removeAccessControlDataIf(boolean removeFromDb, AccessControlData data) throws OseeDataStoreException {
- getService().removeAccessControlDataIf(removeFromDb, data);
- }
-
- public static boolean checkObjectListPermission(Collection<?> objectList, PermissionEnum permission) throws OseeCoreException {
- return getService().checkObjectListPermission(objectList, permission);
- }
-
- public static boolean hasPermission(Object object, PermissionEnum permission) throws OseeCoreException {
- return getService().hasPermission(object, permission);
- }
-
- public static void setPermission(Artifact subject, Object object, PermissionEnum permission) {
- getService().setPermission(subject, object, permission);
- }
-
- public static void lockObjects(Collection<Artifact> objects, Artifact subject) {
- getService().lockObjects(objects, subject);
- }
-
- public static void unLockObjects(Collection<Artifact> objects, Artifact subject) throws OseeDataStoreException, OseeAuthenticationRequiredException {
- getService().unLockObjects(objects, subject);
- }
-
- public static boolean hasLock(Artifact object) {
- return getService().hasLock(object);
- }
-
- public static boolean canUnlockObject(Artifact object, Artifact subject) {
- return getService().canUnlockObject(object, subject);
- }
-
- public static Artifact getSubjectFromLockedObject(Object object) throws OseeCoreException {
- return getService().getSubjectFromLockedObject(object);
- }
-
- public static boolean hasLockAccess(Artifact object) {
- return getService().hasLockAccess(object);
- }
-
- public static boolean isOseeAdmin() throws OseeCoreException {
- return getService().isOseeAdmin();
- }
-
- public static Collection<AccessControlData> getAccessControlList(Object object) {
- return getService().getAccessControlList(object);
- }
-
- public static AccessObject getAccessObject(Object object) {
- return getService().getAccessObject(object);
- }
-
- public static void persistPermission(AccessControlData data) {
- getService().persistPermission(data);
- }
-
- public static void persistPermission(AccessControlData data, boolean isRecursionAllowed) {
- getService().persistPermission(data, isRecursionAllowed);
- }
-
- public static AccessDataQuery getAccessData(Collection<?> objectsToCheck) throws OseeCoreException {
- return getService().getAccessData(UserManager.getUser(), objectsToCheck);
- }
-
-}
+/******************************************************************************* + * Copyright (c) 2004, 2007 Boeing. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Boeing - initial API and implementation + *******************************************************************************/ + +package org.eclipse.osee.framework.access; + +import java.util.Collection; +import java.util.logging.Level; +import org.eclipse.osee.framework.access.internal.AccessControlService; +import org.eclipse.osee.framework.access.internal.Activator; +import org.eclipse.osee.framework.core.enums.PermissionEnum; +import org.eclipse.osee.framework.core.exception.OseeAuthenticationRequiredException; +import org.eclipse.osee.framework.core.exception.OseeCoreException; +import org.eclipse.osee.framework.core.exception.OseeDataStoreException; +import org.eclipse.osee.framework.core.model.access.AccessDataQuery; +import org.eclipse.osee.framework.logging.OseeLog; +import org.eclipse.osee.framework.skynet.core.UserManager; +import org.eclipse.osee.framework.skynet.core.artifact.Artifact; + +/** + * Provides access control for OSEE. <REM2> + * + * @author Jeff C. Phillips + */ + +public class AccessControlManager { + + private AccessControlManager() { + } + + public static AccessControlService getService() { + AccessControlService accessService = Activator.getAccessControlService(); + if (accessService == null) { + OseeLog.log(Activator.class, Level.SEVERE, "Access Service was null"); + } + return accessService; + } + + public static void removeAccessControlDataIf(boolean removeFromDb, AccessControlData data) throws OseeDataStoreException { + getService().removeAccessControlDataIf(removeFromDb, data); + } + + public static boolean checkObjectListPermission(Collection<?> objectList, PermissionEnum permission) throws OseeCoreException { + return getService().checkObjectListPermission(objectList, permission); + } + + public static boolean hasPermission(Object object, PermissionEnum permission) throws OseeCoreException { + return getService().hasPermission(object, permission); + } + + public static void setPermission(Artifact subject, Object object, PermissionEnum permission) { + getService().setPermission(subject, object, permission); + } + + public static void lockObjects(Collection<Artifact> objects, Artifact subject) { + getService().lockObjects(objects, subject); + } + + public static void unLockObjects(Collection<Artifact> objects, Artifact subject) throws OseeDataStoreException, OseeAuthenticationRequiredException { + getService().unLockObjects(objects, subject); + } + + public static boolean hasLock(Artifact object) { + return getService().hasLock(object); + } + + public static boolean canUnlockObject(Artifact object, Artifact subject) { + return getService().canUnlockObject(object, subject); + } + + public static Artifact getSubjectFromLockedObject(Object object) throws OseeCoreException { + return getService().getSubjectFromLockedObject(object); + } + + public static boolean hasLockAccess(Artifact object) { + return getService().hasLockAccess(object); + } + + public static boolean isOseeAdmin() throws OseeCoreException { + return getService().isOseeAdmin(); + } + + public static Collection<AccessControlData> getAccessControlList(Object object) { + return getService().getAccessControlList(object); + } + + public static AccessObject getAccessObject(Object object) { + return getService().getAccessObject(object); + } + + public static void persistPermission(AccessControlData data) { + getService().persistPermission(data); + } + + public static void persistPermission(AccessControlData data, boolean isRecursionAllowed) { + getService().persistPermission(data, isRecursionAllowed); + } + + public static AccessDataQuery getAccessData(Collection<?> objectsToCheck) throws OseeCoreException { + return getService().getAccessData(UserManager.getUser(), objectsToCheck); + } + +} |