]> source.dussan.org Git - archiva.git/commitdiff
package move to o.a.a.r module redback-rback-model
authorOlivier Lamy <olamy@apache.org>
Sat, 7 Apr 2012 22:34:36 +0000 (22:34 +0000)
committerOlivier Lamy <olamy@apache.org>
Sat, 7 Apr 2012 22:34:36 +0000 (22:34 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/redback/redback-core/trunk@1310899 13f79535-47bb-0310-9956-ffa450edef68

111 files changed:
redback-data-management/src/main/java/org/apache/archiva/redback/management/DataManagementTool.java
redback-data-management/src/main/java/org/apache/archiva/redback/management/JdoDataManagementTool.java
redback-data-management/src/test/java/org/apache/archiva/redback/management/DataManagementTest.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/checks/security/AdminAutoCreateCheck.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/checks/security/LockedAdminEnvironmentCheck.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/interceptor/SecureActionBundle.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/model/EditRoleDetails.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/reports/CsvRolesMatrix.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/util/OperationSorter.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/util/PermissionSorter.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/util/ResourceSorter.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/util/RoleSorter.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/util/TemplatedRoleSorter.java
redback-integrations/redback-jsecurity/src/main/java/org/codehaus/redback/jsecurity/RedbackRealm.java
redback-integrations/redback-jsecurity/src/test/java/org/codehaus/redback/jsecurity/RedbackRealmTest.java
redback-integrations/redback-rest/redback-rest-api/src/main/java/org/codehaus/redback/rest/api/model/Operation.java
redback-integrations/redback-rest/redback-rest-api/src/main/java/org/codehaus/redback/rest/api/model/Permission.java
redback-integrations/redback-rest/redback-rest-api/src/main/java/org/codehaus/redback/rest/api/model/Resource.java
redback-integrations/redback-rest/redback-rest-api/src/main/java/org/codehaus/redback/rest/api/model/Role.java
redback-integrations/redback-rest/redback-rest-services/src/main/java/org/codehaus/redback/rest/services/DefaultRoleManagementService.java
redback-integrations/redback-rest/redback-rest-services/src/main/java/org/codehaus/redback/rest/services/DefaultUserService.java
redback-integrations/redback-rest/redback-rest-services/src/test/java/org/codehaus/redback/rest/services/FakeCreateAdminServiceImpl.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/AbstractUserCredentialsAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/admin/AdminConsoleAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/admin/AssignmentsAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/admin/BackupRestoreAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/admin/EditRoleAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/admin/OperationsAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/admin/PermissionsAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/admin/ReportAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/admin/ResourcesAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/admin/RoleCreateAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/admin/RoleModelAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/admin/RolesAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/admin/SystemInfoAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/admin/UserCreateAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/admin/UserDeleteAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/admin/UserEditAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/admin/UserListAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/model/ApplicationRoleDetails.java
redback-integrations/redback-struts2/redback-struts2-integration/src/test/java/org/codehaus/plexus/redback/struts2/action/admin/AbstractUserCredentialsActionTest.java
redback-integrations/redback-struts2/redback-struts2-integration/src/test/java/org/codehaus/plexus/redback/struts2/action/admin/AssignmentsActionTest.java
redback-integrations/redback-struts2/redback-struts2-integration/src/test/java/org/codehaus/plexus/redback/struts2/action/admin/UserEditActionTest.java
redback-integrations/redback-struts2/redback-struts2-integration/src/test/resources/org/codehaus/plexus/redback/struts2/action/admin/AssignmentsActionTest.xml
redback-integrations/redback-struts2/redback-struts2-integration/src/test/resources/org/codehaus/plexus/redback/struts2/action/admin/UserEditActionTest.xml
redback-integrations/redback-struts2/redback-struts2-integration/src/test/resources/spring-context.xml
redback-rbac/redback-authorization-rbac/src/main/java/org/codehaus/plexus/redback/authorization/rbac/RbacAuthorizer.java
redback-rbac/redback-authorization-rbac/src/main/java/org/codehaus/plexus/redback/authorization/rbac/evaluator/DefaultPermissionEvaluator.java
redback-rbac/redback-authorization-rbac/src/main/java/org/codehaus/plexus/redback/authorization/rbac/evaluator/PermissionEvaluator.java
redback-rbac/redback-authorization-rbac/src/test/java/org/codehaus/plexus/redback/authorization/rbac/evaluator/PermissionEvaluatorTest.java
redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/AbstractRBACManager.java [new file with mode: 0644]
redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/AbstractRole.java [new file with mode: 0644]
redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/AbstractUserAssignment.java [new file with mode: 0644]
redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/Operation.java [new file with mode: 0644]
redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/Permission.java [new file with mode: 0644]
redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/RBACManager.java [new file with mode: 0644]
redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/RBACManagerListener.java [new file with mode: 0644]
redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/RBACObjectAssertions.java [new file with mode: 0644]
redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/RbacManagerException.java [new file with mode: 0644]
redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/RbacObjectInvalidException.java [new file with mode: 0644]
redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/RbacObjectNotFoundException.java [new file with mode: 0644]
redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/RbacPermanentException.java [new file with mode: 0644]
redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/RbacSecurityViolation.java [new file with mode: 0644]
redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/Resource.java [new file with mode: 0644]
redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/Role.java [new file with mode: 0644]
redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/TemplatedRole.java [new file with mode: 0644]
redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/UserAssignment.java [new file with mode: 0644]
redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/AbstractRBACManager.java [deleted file]
redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/AbstractRole.java [deleted file]
redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/AbstractUserAssignment.java [deleted file]
redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/Operation.java [deleted file]
redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/Permission.java [deleted file]
redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/RBACManager.java [deleted file]
redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/RBACManagerListener.java [deleted file]
redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/RBACObjectAssertions.java [deleted file]
redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/RbacManagerException.java [deleted file]
redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/RbacObjectInvalidException.java [deleted file]
redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/RbacObjectNotFoundException.java [deleted file]
redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/RbacPermanentException.java [deleted file]
redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/RbacSecurityViolation.java [deleted file]
redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/Resource.java [deleted file]
redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/Role.java [deleted file]
redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/TemplatedRole.java [deleted file]
redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/UserAssignment.java [deleted file]
redback-rbac/redback-rbac-providers/redback-rbac-cached/src/main/java/org/codehaus/plexus/redback/rbac/cached/CachedRbacManager.java
redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/java/org/codehaus/plexus/redback/rbac/cached/CachedRbacManagerPerformanceTest.java
redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/java/org/codehaus/plexus/redback/rbac/cached/CachedRbacManagerTest.java
redback-rbac/redback-rbac-providers/redback-rbac-jdo/src/main/java/org/codehaus/plexus/redback/rbac/jdo/JdoRbacManager.java
redback-rbac/redback-rbac-providers/redback-rbac-jdo/src/main/java/org/codehaus/plexus/redback/rbac/jdo/JdoTool.java
redback-rbac/redback-rbac-providers/redback-rbac-jdo/src/main/mdo/rbac-jdo.mdo
redback-rbac/redback-rbac-providers/redback-rbac-jdo/src/test/java/org/codehaus/plexus/redback/rbac/jdo/JdoRbacManagerTest.java
redback-rbac/redback-rbac-providers/redback-rbac-jdo/src/test/java/org/codehaus/plexus/redback/rbac/jdo/RbacJdoModelStaxTest.java
redback-rbac/redback-rbac-providers/redback-rbac-memory/src/main/java/org/codehaus/plexus/redback/rbac/memory/MemoryOperation.java
redback-rbac/redback-rbac-providers/redback-rbac-memory/src/main/java/org/codehaus/plexus/redback/rbac/memory/MemoryPermission.java
redback-rbac/redback-rbac-providers/redback-rbac-memory/src/main/java/org/codehaus/plexus/redback/rbac/memory/MemoryRbacManager.java
redback-rbac/redback-rbac-providers/redback-rbac-memory/src/main/java/org/codehaus/plexus/redback/rbac/memory/MemoryResource.java
redback-rbac/redback-rbac-providers/redback-rbac-memory/src/main/java/org/codehaus/plexus/redback/rbac/memory/MemoryRole.java
redback-rbac/redback-rbac-providers/redback-rbac-memory/src/main/java/org/codehaus/plexus/redback/rbac/memory/MemoryUserAssignment.java
redback-rbac/redback-rbac-providers/redback-rbac-memory/src/test/java/org/codehaus/plexus/redback/rbac/memory/MemoryRbacManagerTest.java
redback-rbac/redback-rbac-role-manager/src/main/java/org/codehaus/plexus/redback/role/DefaultRoleManager.java
redback-rbac/redback-rbac-role-manager/src/main/java/org/codehaus/plexus/redback/role/processor/DefaultRoleModelProcessor.java
redback-rbac/redback-rbac-role-manager/src/main/java/org/codehaus/plexus/redback/role/template/DefaultRoleTemplateProcessor.java
redback-rbac/redback-rbac-role-manager/src/test/java/org/codehaus/plexus/redback/role/AbstractRoleManagerTest.java
redback-rbac/redback-rbac-role-manager/src/test/java/org/codehaus/plexus/redback/role/JpoxRoleManagerTest.java
redback-rbac/redback-rbac-role-manager/src/test/java/org/codehaus/plexus/redback/role/RoleManagerTest.java
redback-rbac/redback-rbac-role-manager/src/test/java/org/codehaus/plexus/redback/role/processor/RoleModelProcessorTest.java
redback-rbac/redback-rbac-role-manager/src/test/java/org/codehaus/plexus/redback/role/template/RoleTemplateProcessorTest.java
redback-rbac/redback-rbac-tests/src/main/java/org/codehaus/plexus/redback/tests/AbstractRbacManagerPerformanceTestCase.java
redback-rbac/redback-rbac-tests/src/main/java/org/codehaus/plexus/redback/tests/AbstractRbacManagerTestCase.java
redback-rbac/redback-rbac-tests/src/main/java/org/codehaus/plexus/redback/tests/RbacManagerEventTracker.java
redback-rbac/redback-rbac-tests/src/main/java/org/codehaus/plexus/redback/tests/utils/RBACDefaults.java

index 2c72d8ada7ce5837bef4f516caaf11bca15f16cf..70952135da82a38da0c3fbde8faec99ca09fcfcb 100644 (file)
@@ -21,8 +21,8 @@ package org.apache.archiva.redback.management;
 
 import org.apache.archiva.redback.users.UserManager;
 import org.apache.archiva.redback.keys.KeyManager;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
+import org.apache.archiva.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.RbacManagerException;
 
 import javax.xml.stream.XMLStreamException;
 import java.io.File;
index c9460d920ea4ff027b39c3eadbf87c81950be9dd..0b9578efdd421965fb9972f254363c7c2e9164df 100644 (file)
@@ -36,18 +36,18 @@ import javax.xml.stream.XMLStreamException;
 
 import org.apache.archiva.redback.keys.AuthenticationKey;
 import org.apache.archiva.redback.keys.KeyManager;
+import org.apache.archiva.redback.rbac.Operation;
+import org.apache.archiva.redback.rbac.Permission;
+import org.apache.archiva.redback.rbac.RbacManagerException;
+import org.apache.archiva.redback.rbac.Role;
 import org.apache.archiva.redback.users.UserManager;
 import org.apache.archiva.redback.keys.KeyManagerException;
 import org.codehaus.plexus.redback.keys.jdo.AuthenticationKeyDatabase;
 import org.codehaus.plexus.redback.keys.jdo.io.stax.RedbackKeyManagementJdoStaxReader;
 import org.codehaus.plexus.redback.keys.jdo.io.stax.RedbackKeyManagementJdoStaxWriter;
-import org.codehaus.plexus.redback.rbac.Operation;
-import org.codehaus.plexus.redback.rbac.Permission;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.Resource;
-import org.codehaus.plexus.redback.rbac.Role;
-import org.codehaus.plexus.redback.rbac.UserAssignment;
+import org.apache.archiva.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.UserAssignment;
 import org.codehaus.plexus.redback.rbac.jdo.RbacDatabase;
 import org.codehaus.plexus.redback.rbac.jdo.io.stax.RbacJdoModelStaxReader;
 import org.codehaus.plexus.redback.rbac.jdo.io.stax.RbacJdoModelStaxWriter;
index d8ba8b8e671a4c78ac75ad7b1dd87e20ead5bd08..40741526d0dd1012d67294c1a4ea57db4971c7d6 100644 (file)
@@ -23,14 +23,14 @@ import junit.framework.TestCase;
 import org.apache.archiva.redback.common.jdo.UserConfigurableJdoFactory;
 import org.apache.archiva.redback.keys.AuthenticationKey;
 import org.apache.archiva.redback.keys.KeyManager;
+import org.apache.archiva.redback.rbac.Permission;
+import org.apache.archiva.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.UserAssignment;
 import org.apache.archiva.redback.users.UserManager;
 import org.apache.commons.lang.SystemUtils;
 import org.apache.archiva.redback.keys.KeyManagerException;
-import org.codehaus.plexus.redback.rbac.Permission;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.Role;
-import org.codehaus.plexus.redback.rbac.UserAssignment;
+import org.apache.archiva.redback.rbac.RbacManagerException;
 import org.codehaus.plexus.redback.tests.utils.RBACDefaults;
 import org.apache.archiva.redback.users.User;
 import org.codehaus.plexus.util.FileUtils;
index ae328db2a6e3dbc99505cb6ad9d24de5f673eb93..00a8c1d3135070cc689b7f07960ad025d9ebf94c 100644 (file)
@@ -19,13 +19,13 @@ package org.codehaus.redback.integration.checks.security;
  * under the License.
  */
 
+import org.apache.archiva.redback.rbac.RBACManager;
 import org.apache.archiva.redback.users.UserNotFoundException;
 import org.apache.commons.lang.StringUtils;
 import org.apache.archiva.redback.authentication.PasswordBasedAuthenticationDataSource;
 import org.apache.archiva.redback.configuration.UserConfiguration;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.RbacManagerException;
+import org.apache.archiva.redback.rbac.Role;
 import org.codehaus.plexus.redback.role.RoleManager;
 import org.codehaus.plexus.redback.role.RoleManagerException;
 import org.codehaus.plexus.redback.system.SecuritySession;
index 4b47b05bbf23da07de63f5f38a581056061400ee..f47e4742189dbd8d5e33599e08fb652855c007af 100644 (file)
@@ -19,10 +19,10 @@ package org.codehaus.redback.integration.checks.security;
  * under the License.
  */
 
+import org.apache.archiva.redback.rbac.RbacManagerException;
 import org.apache.archiva.redback.users.UserNotFoundException;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.UserAssignment;
+import org.apache.archiva.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.UserAssignment;
 import org.codehaus.plexus.redback.system.check.EnvironmentCheck;
 import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.users.UserManager;
index 05e04d140347a9e4abc19981764a17a0858927cd..4e818e5368921da5fdc1c734babe598d210e8bd8 100644 (file)
@@ -22,7 +22,7 @@ package org.codehaus.redback.integration.interceptor;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.codehaus.plexus.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.Resource;
 
 /**
  * SecureActionBundle:
index 537eee1dea56345abfcff55cd65a66d128231a91..f7cc94b5526ab6ed7c5f5fd9357375d05a2f0303 100644 (file)
@@ -19,8 +19,8 @@ package org.codehaus.redback.integration.model;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.rbac.Permission;
-import org.codehaus.plexus.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.Permission;
+import org.apache.archiva.redback.rbac.Role;
 
 /**
  * EditRoleDetails - Existing user Role Details.
index 58dec03f41c6c8ed2688463de2ef14a95c31775d..4c7f5f345270759bf7a2b8ae636cf1d7cb36a914 100644 (file)
@@ -18,12 +18,12 @@ package org.codehaus.redback.integration.reports;
  * specific language governing permissions and limitations
  * under the License.
  */
+import org.apache.archiva.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.RbacManagerException;
+import org.apache.archiva.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.UserAssignment;
 import org.apache.archiva.redback.users.UserManager;
 import org.apache.commons.lang.StringEscapeUtils;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.Role;
-import org.codehaus.plexus.redback.rbac.UserAssignment;
 import org.codehaus.plexus.redback.system.SecuritySystem;
 import org.apache.archiva.redback.users.User;
 import org.codehaus.redback.integration.util.RoleSorter;
index ebf989aab65b1c498aecca79839d4da05350a6e6..2f93f283b12e0d8fda13fea0a91ca6524a6fe181 100644 (file)
@@ -21,7 +21,7 @@ package org.codehaus.redback.integration.util;
 
 import java.util.Comparator;
 
-import org.codehaus.plexus.redback.rbac.Operation;
+import org.apache.archiva.redback.rbac.Operation;
 
 /**
  * OperationSorter
index bb78ad68e774d460f7a075b879466172b812e780..f49678e34e9e610669df133a78a8b714e4f0480b 100644 (file)
@@ -21,7 +21,7 @@ package org.codehaus.redback.integration.util;
 
 import java.util.Comparator;
 
-import org.codehaus.plexus.redback.rbac.Permission;
+import org.apache.archiva.redback.rbac.Permission;
 
 /**
  * PermissionSorter
index 2519dad989c65ef61bca96482e848a003a8c2c1d..bc53ac575554c9f2a1e86e1eb68399285119c301 100644 (file)
@@ -21,7 +21,7 @@ package org.codehaus.redback.integration.util;
 
 import java.util.Comparator;
 
-import org.codehaus.plexus.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.Resource;
 
 /**
  * ResourceSorter
index 4e0c3257fcf374ac748e7392c41055480812fa79..8ba8c762c9797d57365ca9fd19bae73bba362d4d 100644 (file)
@@ -21,7 +21,7 @@ package org.codehaus.redback.integration.util;
 
 import java.util.Comparator;
 
-import org.codehaus.plexus.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.Role;
 
 /**
  * RoleSorter
index a3473a489e03037f0b452e17fb7d0fbb58c701b4..5e4fb7fa9368db98efed453ea34b481e7640fbbe 100644 (file)
@@ -21,7 +21,7 @@ package org.codehaus.redback.integration.util;
 
 import java.util.Comparator;
 
-import org.codehaus.plexus.redback.rbac.TemplatedRole;
+import org.apache.archiva.redback.rbac.TemplatedRole;
 
 /**
  * TemplatedRoleSorter
index 208fcec0c6ae53d89e8cf12bd548e873587ed1ba..5880d4305d8bfaf3412d9966d26ee03b103e3139 100644 (file)
@@ -25,12 +25,12 @@ import java.util.Set;
 
 import org.apache.archiva.redback.policy.AccountLockedException;
 import org.apache.archiva.redback.policy.UserSecurityPolicy;
+import org.apache.archiva.redback.rbac.Permission;
+import org.apache.archiva.redback.rbac.UserAssignment;
 import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.users.UserNotFoundException;
-import org.codehaus.plexus.redback.rbac.Permission;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.UserAssignment;
+import org.apache.archiva.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.RbacManagerException;
 import org.apache.archiva.redback.users.UserManager;
 import org.jsecurity.authc.AuthenticationException;
 import org.jsecurity.authc.AuthenticationInfo;
index 300791be71459e9098e1f4f26e1ff7212d7a71c9..8289fca23f27641eaf98431a0dd6f85be302a3e2 100644 (file)
@@ -21,13 +21,13 @@ package org.codehaus.redback.jsecurity;
 
 import junit.framework.TestCase;
 import org.apache.archiva.redback.policy.UserSecurityPolicy;
+import org.apache.archiva.redback.rbac.Role;
 import org.apache.archiva.redback.users.User;
-import org.codehaus.plexus.redback.rbac.Operation;
-import org.codehaus.plexus.redback.rbac.Permission;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.Resource;
-import org.codehaus.plexus.redback.rbac.Role;
-import org.codehaus.plexus.redback.rbac.UserAssignment;
+import org.apache.archiva.redback.rbac.Operation;
+import org.apache.archiva.redback.rbac.Permission;
+import org.apache.archiva.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.UserAssignment;
 import org.apache.archiva.redback.users.UserManager;
 import org.jsecurity.authc.IncorrectCredentialsException;
 import org.jsecurity.authc.UsernamePasswordToken;
index 68dbfaddfb5450ba01bf5678b9fc14527079882e..724b03e76db44158e92d6ae0778d599b030abcbf 100644 (file)
@@ -40,7 +40,7 @@ public class Operation
         // no op
     }
 
-    public Operation( org.codehaus.plexus.redback.rbac.Operation operation )
+    public Operation( org.apache.archiva.redback.rbac.Operation operation )
     {
         this.name = operation.getName();
         this.description = operation.getDescription();
index 55226ea5e06611438d3e73845d694a9fbd35abbd..711b5b680c6a984487ddbca77421b0e22ede930e 100644 (file)
@@ -44,7 +44,7 @@ public class Permission
         // no op
     }
 
-    public Permission( org.codehaus.plexus.redback.rbac.Permission permission )
+    public Permission( org.apache.archiva.redback.rbac.Permission permission )
     {
         this.name = permission.getName();
         this.description = permission.getDescription();
index 13465d84abc62b97ee731ce114e69ff2e00d2dab..ae016edf0f0967fff2135ff013190ba650196d09 100644 (file)
@@ -40,7 +40,7 @@ public class Resource
         // no op
     }
 
-    public Resource( org.codehaus.plexus.redback.rbac.Resource resource )
+    public Resource( org.apache.archiva.redback.rbac.Resource resource )
     {
         this.identifier = resource.getIdentifier();
         this.pattern = resource.isPattern();
index 1e8701e39c9d76f65a734515153ae7b2a040ac46..b9ce7a65128682a15801cd12145be7f016b8c820 100644 (file)
@@ -99,7 +99,7 @@ public class Role
         this.name = name;
     }
 
-    public Role( org.codehaus.plexus.redback.rbac.Role role )
+    public Role( org.apache.archiva.redback.rbac.Role role )
     {
         this.name = role.getName();
         this.description = role.getDescription();
@@ -114,7 +114,7 @@ public class Role
         }
         else
         {
-            for ( org.codehaus.plexus.redback.rbac.Permission p : role.getPermissions() )
+            for ( org.apache.archiva.redback.rbac.Permission p : role.getPermissions() )
             {
                 this.permissions.add( new Permission( p ) );
             }
index ae2d32727f97447edb556ff3a920238acb9807c7..82050aa17d77ae39b8a4cc361ac6a886d90ae314 100644 (file)
@@ -18,15 +18,15 @@ package org.codehaus.redback.rest.services;
  * under the License.
  */
 
+import org.apache.archiva.redback.rbac.Permission;
+import org.apache.archiva.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.RbacManagerException;
+import org.apache.archiva.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.UserAssignment;
 import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.users.UserManager;
 import org.apache.archiva.redback.users.UserNotFoundException;
 import org.apache.commons.lang.StringUtils;
-import org.codehaus.plexus.redback.rbac.Permission;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.Resource;
-import org.codehaus.plexus.redback.rbac.UserAssignment;
 import org.codehaus.plexus.redback.role.RoleManager;
 import org.codehaus.plexus.redback.role.RoleManagerException;
 import org.codehaus.plexus.redback.role.model.ModelApplication;
@@ -248,12 +248,12 @@ public class DefaultRoleManagementService
         }
         try
         {
-            List<org.codehaus.plexus.redback.rbac.Role> roles =
+            List<org.apache.archiva.redback.rbac.Role> roles =
                 filterAssignableRoles( rbacManager.getEffectivelyAssignedRoles( username ) );
 
             List<Role> effectivelyAssignedRoles = new ArrayList<Role>( roles.size() );
 
-            for ( org.codehaus.plexus.redback.rbac.Role r : roles )
+            for ( org.apache.archiva.redback.rbac.Role r : roles )
             {
                 effectivelyAssignedRoles.add( new Role( r ) );
             }
@@ -293,7 +293,7 @@ public class DefaultRoleManagementService
     {
         try
         {
-            List<org.codehaus.plexus.redback.rbac.Role> roles = rbacManager.getAllRoles();
+            List<org.apache.archiva.redback.rbac.Role> roles = rbacManager.getAllRoles();
 
             if ( roles == null )
             {
@@ -304,7 +304,7 @@ public class DefaultRoleManagementService
 
             List<Role> res = new ArrayList<Role>( roles.size() );
 
-            for ( org.codehaus.plexus.redback.rbac.Role r : roles )
+            for ( org.apache.archiva.redback.rbac.Role r : roles )
             {
                 res.add( new Role( r ) );
             }
@@ -322,7 +322,7 @@ public class DefaultRoleManagementService
     {
         try
         {
-            List<org.codehaus.plexus.redback.rbac.Role> roles = rbacManager.getAllRoles();
+            List<org.apache.archiva.redback.rbac.Role> roles = rbacManager.getAllRoles();
 
             if ( roles == null )
             {
@@ -333,7 +333,7 @@ public class DefaultRoleManagementService
 
             List<Role> res = new ArrayList<Role>( roles.size() );
 
-            for ( org.codehaus.plexus.redback.rbac.Role r : roles )
+            for ( org.apache.archiva.redback.rbac.Role r : roles )
             {
                 res.add( getRole( r.getName() ) );
             }
@@ -346,12 +346,12 @@ public class DefaultRoleManagementService
         }
     }
 
-    private List<org.codehaus.plexus.redback.rbac.Role> filterAssignableRoles(
-        Collection<org.codehaus.plexus.redback.rbac.Role> roles )
+    private List<org.apache.archiva.redback.rbac.Role> filterAssignableRoles(
+        Collection<org.apache.archiva.redback.rbac.Role> roles )
     {
-        List<org.codehaus.plexus.redback.rbac.Role> assignableRoles =
-            new ArrayList<org.codehaus.plexus.redback.rbac.Role>( roles.size() );
-        for ( org.codehaus.plexus.redback.rbac.Role r : roles )
+        List<org.apache.archiva.redback.rbac.Role> assignableRoles =
+            new ArrayList<org.apache.archiva.redback.rbac.Role>( roles.size() );
+        for ( org.apache.archiva.redback.rbac.Role r : roles )
         {
             if ( r.isAssignable() )
             {
@@ -366,10 +366,10 @@ public class DefaultRoleManagementService
     {
         try
         {
-            org.codehaus.plexus.redback.rbac.Role rbacRole = rbacManager.getRole( roleName );
+            org.apache.archiva.redback.rbac.Role rbacRole = rbacManager.getRole( roleName );
             Role role = new Role( rbacRole );
 
-            Map<String, org.codehaus.plexus.redback.rbac.Role> parentRoles = rbacManager.getParentRoles( rbacRole );
+            Map<String, org.apache.archiva.redback.rbac.Role> parentRoles = rbacManager.getParentRoles( rbacRole );
             for ( String parentRoleName : parentRoles.keySet() )
             {
                 role.getParentRoleNames().add( parentRoleName );
@@ -445,7 +445,7 @@ public class DefaultRoleManagementService
     {
         try
         {
-            org.codehaus.plexus.redback.rbac.Role rbacRole = rbacManager.getRole( roleName );
+            org.apache.archiva.redback.rbac.Role rbacRole = rbacManager.getRole( roleName );
             rbacRole.setDescription( description );
             rbacManager.saveRole( rbacRole );
         }
@@ -570,7 +570,7 @@ public class DefaultRoleManagementService
                 rbacManager.saveUserAssignment( assignment );
             }
 
-            List<org.codehaus.plexus.redback.rbac.Role> allRoles =
+            List<org.apache.archiva.redback.rbac.Role> allRoles =
                 filterRolesForCurrentUserAccess( rbacManager.getAllRoles() );
 
             List<ModelApplication> modelApplications = roleManager.getModel().getApplications();
@@ -584,7 +584,7 @@ public class DefaultRoleManagementService
                 applicationRoles.setDescription( modelApplication.getDescription() );
                 applicationRoles.setName( modelApplication.getId() );
 
-                Collection<org.codehaus.plexus.redback.rbac.Role> appRoles =
+                Collection<org.apache.archiva.redback.rbac.Role> appRoles =
                     filterApplicationRoles( modelApplication, allRoles, modelApplication.getTemplates() );
 
                 applicationRoles.setGlobalRoles( toRoleNames( appRoles ) );
@@ -690,10 +690,10 @@ public class DefaultRoleManagementService
     // Internal methods
     //----------------------------------------------------------------
 
-    private org.codehaus.plexus.redback.rbac.Role isInList( String roleName,
-                                                            Collection<org.codehaus.plexus.redback.rbac.Role> roles )
+    private org.apache.archiva.redback.rbac.Role isInList( String roleName,
+                                                            Collection<org.apache.archiva.redback.rbac.Role> roles )
     {
-        for ( org.codehaus.plexus.redback.rbac.Role role : roles )
+        for ( org.apache.archiva.redback.rbac.Role role : roles )
         {
             if ( roleName.equals( role.getName() ) )
             {
@@ -703,17 +703,17 @@ public class DefaultRoleManagementService
         return null;
     }
 
-    private Collection<org.codehaus.plexus.redback.rbac.Role> filterApplicationRoles( ModelApplication application,
-                                                                                      List<org.codehaus.plexus.redback.rbac.Role> allRoles,
+    private Collection<org.apache.archiva.redback.rbac.Role> filterApplicationRoles( ModelApplication application,
+                                                                                      List<org.apache.archiva.redback.rbac.Role> allRoles,
                                                                                       List<ModelTemplate> applicationTemplates )
     {
-        Set<org.codehaus.plexus.redback.rbac.Role> applicationRoles =
-            new HashSet<org.codehaus.plexus.redback.rbac.Role>();
+        Set<org.apache.archiva.redback.rbac.Role> applicationRoles =
+            new HashSet<org.apache.archiva.redback.rbac.Role>();
         List<ModelRole> roles = application.getRoles();
 
         for ( ModelRole modelRole : roles )
         {
-            org.codehaus.plexus.redback.rbac.Role r = isInList( modelRole.getName(), allRoles );
+            org.apache.archiva.redback.rbac.Role r = isInList( modelRole.getName(), allRoles );
             if ( r != null )
             {
                 applicationRoles.add( r );
@@ -724,7 +724,7 @@ public class DefaultRoleManagementService
 
         for ( ModelTemplate modelTemplate : applicationTemplates )
         {
-            for ( org.codehaus.plexus.redback.rbac.Role r : allRoles )
+            for ( org.apache.archiva.redback.rbac.Role r : allRoles )
             {
                 if ( StringUtils.startsWith( r.getName(),
                                              modelTemplate.getNamePrefix() + modelTemplate.getDelimiter() ) )
@@ -751,11 +751,11 @@ public class DefaultRoleManagementService
         return false;
     }
 
-    private List<String> toRoleNames( Collection<org.codehaus.plexus.redback.rbac.Role> roles )
+    private List<String> toRoleNames( Collection<org.apache.archiva.redback.rbac.Role> roles )
     {
         List<String> names = new ArrayList<String>( roles.size() );
 
-        for ( org.codehaus.plexus.redback.rbac.Role r : roles )
+        for ( org.apache.archiva.redback.rbac.Role r : roles )
         {
             names.add( r.getName() );
         }
@@ -788,12 +788,12 @@ public class DefaultRoleManagementService
     }
 
     private Set<String> discoverResources( List<ModelTemplate> applicationTemplates,
-                                           Collection<org.codehaus.plexus.redback.rbac.Role> roles )
+                                           Collection<org.apache.archiva.redback.rbac.Role> roles )
     {
         Set<String> resources = new HashSet<String>();
         for ( ModelTemplate modelTemplate : applicationTemplates )
         {
-            for ( org.codehaus.plexus.redback.rbac.Role role : roles )
+            for ( org.apache.archiva.redback.rbac.Role role : roles )
             {
                 String roleName = role.getName();
                 if ( roleName.startsWith( modelTemplate.getNamePrefix() ) )
@@ -814,11 +814,11 @@ public class DefaultRoleManagementService
      *
      * @param roleList
      * @return
-     * @throws org.codehaus.plexus.redback.rbac.RbacManagerException
+     * @throws org.apache.archiva.redback.rbac.RbacManagerException
      *
      */
-    protected List<org.codehaus.plexus.redback.rbac.Role> filterRolesForCurrentUserAccess(
-        List<org.codehaus.plexus.redback.rbac.Role> roleList )
+    protected List<org.apache.archiva.redback.rbac.Role> filterRolesForCurrentUserAccess(
+        List<org.apache.archiva.redback.rbac.Role> roleList )
         throws RedbackServiceException
     {
         RedbackRequestInformation redbackRequestInformation = RedbackAuthenticationThreadLocal.get();
@@ -829,8 +829,8 @@ public class DefaultRoleManagementService
         }
         String currentUser = redbackRequestInformation.getUser().getUsername();
 
-        List<org.codehaus.plexus.redback.rbac.Role> filteredRoleList =
-            new ArrayList<org.codehaus.plexus.redback.rbac.Role>();
+        List<org.apache.archiva.redback.rbac.Role> filteredRoleList =
+            new ArrayList<org.apache.archiva.redback.rbac.Role>();
         try
         {
             Map<String, List<Permission>> assignedPermissionMap = rbacManager.getAssignedPermissionMap( currentUser );
@@ -864,7 +864,7 @@ public class DefaultRoleManagementService
 
             // we should have a list of resourceGrants now, this will provide us with the information necessary to restrict
             // the role list
-            for ( org.codehaus.plexus.redback.rbac.Role role : roleList )
+            for ( org.apache.archiva.redback.rbac.Role role : roleList )
             {
                 int delimiterIndex = role.getName().indexOf( delimiter );
                 for ( String resourceIdentifier : resourceGrants )
index d7d4696c0d4362ad5e341329f3012fc197b4b137..5d6c8de2de2ca89b9751d3ceeba7ad1745d3b7e9 100644 (file)
@@ -24,6 +24,8 @@ import org.apache.archiva.redback.configuration.UserConfiguration;
 import org.apache.archiva.redback.keys.AuthenticationKey;
 import org.apache.archiva.redback.policy.AccountLockedException;
 import org.apache.archiva.redback.policy.MustChangePasswordException;
+import org.apache.archiva.redback.rbac.RbacManagerException;
+import org.apache.archiva.redback.rbac.UserAssignment;
 import org.apache.archiva.redback.users.UserManager;
 import org.apache.archiva.redback.users.UserNotFoundException;
 import org.apache.commons.lang.StringUtils;
@@ -35,10 +37,8 @@ import org.apache.archiva.redback.keys.KeyManagerException;
 import org.apache.archiva.redback.keys.KeyNotFoundException;
 import org.apache.archiva.redback.policy.PasswordEncoder;
 import org.apache.archiva.redback.policy.UserSecurityPolicy;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.RbacObjectNotFoundException;
-import org.codehaus.plexus.redback.rbac.UserAssignment;
+import org.apache.archiva.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.RbacObjectNotFoundException;
 import org.codehaus.plexus.redback.role.RoleManager;
 import org.codehaus.plexus.redback.role.RoleManagerException;
 import org.codehaus.plexus.redback.system.SecuritySystem;
@@ -733,11 +733,11 @@ public class DefaultUserService
     {
         try
         {
-            Set<org.codehaus.plexus.redback.rbac.Permission> permissions =
+            Set<org.apache.archiva.redback.rbac.Permission> permissions =
                 rbacManager.getAssignedPermissions( userName );
             // FIXME return guest permissions !!
             List<Permission> userPermissions = new ArrayList<Permission>( permissions.size() );
-            for ( org.codehaus.plexus.redback.rbac.Permission p : permissions )
+            for ( org.apache.archiva.redback.rbac.Permission p : permissions )
             {
                 Permission permission = new Permission();
                 permission.setName( p.getName() );
index 26d4f61500e0b19ca646661dacd2dc4521330bf0..881ce83a12c185295e9368451df10b111545ea8d 100644 (file)
@@ -19,9 +19,9 @@ package org.codehaus.redback.rest.services;
  * under the License.
  */
 
+import org.apache.archiva.redback.rbac.RBACManager;
 import org.apache.archiva.redback.users.UserManager;
 import org.apache.archiva.redback.configuration.UserConfiguration;
-import org.codehaus.plexus.redback.rbac.RBACManager;
 import org.codehaus.plexus.redback.role.RoleManager;
 import org.codehaus.redback.rest.api.services.UserService;
 
index c3fae02e81f02fade6aa063c346dce74cb731c2b..bc7476fa9afa1773fd433ba2f1852a76c991ccfa 100644 (file)
@@ -19,13 +19,13 @@ package org.codehaus.plexus.redback.struts2.action;
  * under the License.
  */
 
+import org.apache.archiva.redback.rbac.Permission;
+import org.apache.archiva.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.Role;
 import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.policy.PasswordRuleViolationException;
-import org.codehaus.plexus.redback.rbac.Permission;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.Resource;
-import org.codehaus.plexus.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.RbacManagerException;
 import org.codehaus.plexus.redback.system.SecuritySystem;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.redback.integration.model.UserCredentials;
@@ -170,7 +170,7 @@ public abstract class AbstractUserCredentialsAction
      *
      * @param roleList
      * @return
-     * @throws org.codehaus.plexus.redback.rbac.RbacManagerException
+     * @throws org.apache.archiva.redback.rbac.RbacManagerException
      *
      */
     protected List<Role> filterRolesForCurrentUserAccess( List<Role> roleList )
index ed78660da78179c1aa8874da78559cc56fcd2ee5..7d1cfdfb6841e02c2d5e9675ebf532a90a624881 100644 (file)
@@ -19,7 +19,7 @@ package org.codehaus.plexus.redback.struts2.action.admin;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.Resource;
 import org.codehaus.plexus.redback.struts2.action.AbstractSecurityAction;
 import org.codehaus.redback.integration.interceptor.SecureActionBundle;
 import org.codehaus.redback.integration.interceptor.SecureActionException;
index b0c0237e7131a3ed0085d987155b6bd88d1e162e..47f0e6cd11a692178e1b8462749ea8cc57efd46d 100644 (file)
@@ -19,13 +19,12 @@ package org.codehaus.plexus.redback.struts2.action.admin;
  * under the License.
  */
 
+import org.apache.archiva.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.UserAssignment;
 import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.users.UserNotFoundException;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.RbacObjectNotFoundException;
-import org.codehaus.plexus.redback.rbac.Resource;
-import org.codehaus.plexus.redback.rbac.Role;
-import org.codehaus.plexus.redback.rbac.UserAssignment;
+import org.apache.archiva.redback.rbac.RbacManagerException;
 import org.codehaus.plexus.redback.role.RoleManager;
 import org.codehaus.plexus.redback.role.model.ModelApplication;
 import org.codehaus.plexus.redback.struts2.action.AbstractUserCredentialsAction;
@@ -128,7 +127,7 @@ public class AssignmentsAction
      * Duplicate role assignment needs to be taken care of.
      * 
      * @throws RbacManagerException
-     * @throws RbacObjectNotFoundException
+     * @throws org.apache.archiva.redback.rbac.RbacObjectNotFoundException
      */
     @SuppressWarnings( "unchecked" )
     public String show()
index 871da592f4e0ee4f3b46374e014eb1a4e7035d3d..af1d7f28db569e0749dd61a1fd420053553ffeca 100644 (file)
@@ -20,11 +20,11 @@ package org.codehaus.plexus.redback.struts2.action.admin;
  */
 
 import com.opensymphony.xwork2.Preparable;
+import org.apache.archiva.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.Resource;
 import org.apache.commons.lang.StringUtils;
 import org.apache.archiva.redback.keys.KeyManager;
 import org.apache.archiva.redback.management.DataManagementTool;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.Resource;
 import org.codehaus.plexus.redback.struts2.action.AbstractSecurityAction;
 import org.apache.archiva.redback.users.UserManager;
 import org.codehaus.redback.integration.interceptor.SecureAction;
index 28204bc21d0843f657c924701a03858f87b46158..d1d81bfb100151ac70d28fb6807c84b2c0207a04 100644 (file)
@@ -19,13 +19,13 @@ package org.codehaus.plexus.redback.struts2.action.admin;
  * under the License.
  */
 
+import org.apache.archiva.redback.rbac.Permission;
+import org.apache.archiva.redback.rbac.RbacManagerException;
+import org.apache.archiva.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.UserAssignment;
 import org.apache.archiva.redback.users.User;
 import org.apache.commons.lang.StringEscapeUtils;
-import org.codehaus.plexus.redback.rbac.Permission;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.Resource;
-import org.codehaus.plexus.redback.rbac.Role;
-import org.codehaus.plexus.redback.rbac.UserAssignment;
 import org.codehaus.plexus.redback.struts2.action.AbstractUserCredentialsAction;
 import org.codehaus.plexus.redback.struts2.action.AuditEvent;
 import org.apache.archiva.redback.users.UserManager;
index df6bede40b854abbd2850ad5c2274b4a8cff05df..1fcef5a3c74fd3643bb015f0b928e9d00036c601 100644 (file)
@@ -19,10 +19,10 @@ package org.codehaus.plexus.redback.struts2.action.admin;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.rbac.Operation;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.Operation;
+import org.apache.archiva.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.RbacManagerException;
+import org.apache.archiva.redback.rbac.Resource;
 import org.codehaus.plexus.redback.struts2.action.RedbackActionSupport;
 import org.codehaus.redback.integration.interceptor.SecureActionBundle;
 import org.codehaus.redback.integration.interceptor.SecureActionException;
index f2daf83455c7bbcdbd9e2a16288825380b7a4205..17a8722a30a3904881119812c78dfc3dce5983f6 100644 (file)
@@ -19,11 +19,11 @@ package org.codehaus.plexus.redback.struts2.action.admin;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.rbac.Operation;
-import org.codehaus.plexus.redback.rbac.Permission;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.Operation;
+import org.apache.archiva.redback.rbac.Permission;
+import org.apache.archiva.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.RbacManagerException;
 import org.codehaus.plexus.redback.struts2.action.RedbackActionSupport;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.redback.integration.interceptor.SecureActionBundle;
index 7386b8b1cebd950605ea422b7003a94a36b5f0f2..946fad19149f084eeaefd5e9388e4f34fb5d189d 100644 (file)
@@ -27,7 +27,7 @@ import javax.inject.Inject;
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.struts2.ServletActionContext;
-import org.codehaus.plexus.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.Resource;
 import org.codehaus.plexus.redback.struts2.action.AbstractSecurityAction;
 import org.codehaus.redback.integration.interceptor.SecureActionBundle;
 import org.codehaus.redback.integration.interceptor.SecureActionException;
index f45e3d4fef0d9c023cdf9afdcc1665a55c555ba5..7f6be5e4ec7aedb7980c1ac5229ac59deb3d7fec 100644 (file)
@@ -19,9 +19,9 @@ package org.codehaus.plexus.redback.struts2.action.admin;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.RbacManagerException;
 import org.codehaus.plexus.redback.struts2.action.AbstractSecurityAction;
 import org.codehaus.redback.integration.interceptor.SecureActionBundle;
 import org.codehaus.redback.integration.interceptor.SecureActionException;
index 4c490221e29b8ae4bf44f27f1b810ede69259606..bdfb9ab79e0c0fce8db5ff493729a89ae17ee2a3 100644 (file)
@@ -19,11 +19,11 @@ package org.codehaus.plexus.redback.struts2.action.admin;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.rbac.Permission;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.Resource;
-import org.codehaus.plexus.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.Permission;
+import org.apache.archiva.redback.rbac.RbacManagerException;
+import org.apache.archiva.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.RBACManager;
 import org.codehaus.plexus.redback.struts2.action.AbstractSecurityAction;
 import org.codehaus.plexus.redback.struts2.action.AuditEvent;
 import org.codehaus.plexus.util.StringUtils;
index 9040089dfb7afa929559db768bd055b81efc3d35..27fd637fe7548f38d8627fde9fecf3727a3fe5b3 100644 (file)
@@ -19,7 +19,7 @@ package org.codehaus.plexus.redback.struts2.action.admin;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.Resource;
 import org.codehaus.plexus.redback.role.RoleManager;
 import org.codehaus.plexus.redback.role.model.RedbackRoleModel;
 import org.codehaus.plexus.redback.struts2.action.AbstractSecurityAction;
index 21974b6b4410ca28c93583d2cf49360407ea59b0..52451221815df93b6e586242d83dc25c028f94ae 100644 (file)
@@ -19,9 +19,9 @@ package org.codehaus.plexus.redback.struts2.action.admin;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.Resource;
-import org.codehaus.plexus.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.RbacManagerException;
 import org.codehaus.plexus.redback.struts2.action.AbstractUserCredentialsAction;
 import org.codehaus.redback.integration.interceptor.SecureActionBundle;
 import org.codehaus.redback.integration.interceptor.SecureActionException;
index fd9632cf7312b26d57eea2546982e69a745f92ad..c5392e1e7d58043780f462684a38133a1c385770 100644 (file)
@@ -19,11 +19,11 @@ package org.codehaus.plexus.redback.struts2.action.admin;
  * under the License.
  */
 
+import org.apache.archiva.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.Resource;
 import org.apache.commons.beanutils.PropertyUtils;
 import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.commons.lang.StringUtils;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.Resource;
 import org.codehaus.plexus.redback.struts2.action.AbstractSecurityAction;
 import org.codehaus.plexus.redback.system.SecuritySystem;
 import org.codehaus.plexus.registry.Registry;
index 0042847ba94e325e6d3a251e1746342f6b00aac0..7e5a3f66ebb692a5158d9b3ebd082e69193a90c9 100644 (file)
@@ -22,7 +22,7 @@ package org.codehaus.plexus.redback.struts2.action.admin;
 import java.util.Arrays;
 
 import org.apache.archiva.redback.policy.UserSecurityPolicy;
-import org.codehaus.plexus.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.Resource;
 import org.codehaus.plexus.redback.struts2.action.AbstractUserCredentialsAction;
 import org.codehaus.plexus.redback.struts2.action.AuditEvent;
 import org.apache.archiva.redback.users.User;
index 18cd5eca3cc272a5c4c7b4e3526d753b79ae6530..8987c96961881f38699735dffc80882afc9ec869 100644 (file)
@@ -19,13 +19,13 @@ package org.codehaus.plexus.redback.struts2.action.admin;
  * under the License.
  */
 
+import org.apache.archiva.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.RbacObjectInvalidException;
+import org.apache.archiva.redback.rbac.Resource;
 import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.users.UserManager;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.RbacObjectInvalidException;
-import org.codehaus.plexus.redback.rbac.RbacObjectNotFoundException;
-import org.codehaus.plexus.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.RbacManagerException;
+import org.apache.archiva.redback.rbac.RbacObjectNotFoundException;
 import org.codehaus.plexus.redback.struts2.action.AbstractSecurityAction;
 import org.codehaus.plexus.redback.struts2.action.AuditEvent;
 import org.codehaus.plexus.redback.struts2.action.CancellableAction;
index 697b9a1278ea0fd86bdb1760b9edef51bd11d1e5..b848329b15085666561bee98c27eeeefb0cecf69 100644 (file)
@@ -20,14 +20,14 @@ package org.codehaus.plexus.redback.struts2.action.admin;
  */
 
 import org.apache.archiva.redback.policy.PasswordEncoder;
+import org.apache.archiva.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.Resource;
 import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.users.UserNotFoundException;
 import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.archiva.redback.policy.PasswordRuleViolationException;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.Resource;
-import org.codehaus.plexus.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.RbacManagerException;
+import org.apache.archiva.redback.rbac.Role;
 import org.codehaus.plexus.redback.struts2.action.AuditEvent;
 import org.codehaus.plexus.redback.struts2.action.CancellableAction;
 import org.codehaus.plexus.redback.system.DefaultSecuritySession;
@@ -70,7 +70,7 @@ public class UserEditAction
     private RBACManager rbacManager;
 
     /**
-     * A List of {@link org.codehaus.plexus.redback.rbac.Role} objects.
+     * A List of {@link org.apache.archiva.redback.rbac.Role} objects.
      */
     private List<Role> effectivelyAssignedRoles;
 
index 566dfd06a753bdb6ffacc642074dea4cea701012..388b57c3e02275656db5ebc6aaf7690e063d7241 100644 (file)
@@ -19,15 +19,15 @@ package org.codehaus.plexus.redback.struts2.action.admin;
  * under the License.
  */
 
+import org.apache.archiva.redback.rbac.RbacManagerException;
+import org.apache.archiva.redback.rbac.RbacObjectNotFoundException;
+import org.apache.archiva.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.UserAssignment;
 import org.apache.archiva.redback.users.User;
 import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.struts2.ServletActionContext;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.RbacObjectNotFoundException;
-import org.codehaus.plexus.redback.rbac.Resource;
-import org.codehaus.plexus.redback.rbac.Role;
-import org.codehaus.plexus.redback.rbac.UserAssignment;
+import org.apache.archiva.redback.rbac.RBACManager;
 import org.codehaus.plexus.redback.struts2.action.AbstractSecurityAction;
 import org.codehaus.plexus.redback.system.SecuritySystem;
 import org.apache.archiva.redback.users.UserManager;
index fdfebeabd34fbf88af662ad0b76cda93be9f41a1..366885d7d904e0da751c9d0a714d13f352c92e9a 100644 (file)
@@ -19,7 +19,7 @@ package org.codehaus.plexus.redback.struts2.model;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.Role;
 import org.codehaus.plexus.redback.role.model.ModelApplication;
 import org.codehaus.plexus.redback.role.model.ModelRole;
 import org.codehaus.plexus.redback.role.model.ModelTemplate;
index 7f92eb33a5c8c6285ffd19677cc75d9d4b395881..82593600f3ed15ec4558fc75f481da513308edff 100644 (file)
@@ -22,14 +22,14 @@ package org.codehaus.plexus.redback.struts2.action.admin;
 import net.sf.ehcache.CacheManager;
 import org.apache.archiva.redback.policy.AccountLockedException;
 import org.apache.archiva.redback.policy.MustChangePasswordException;
+import org.apache.archiva.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.RbacObjectInvalidException;
 import org.apache.archiva.redback.users.UserManager;
 import org.apache.struts2.StrutsSpringTestCase;
 import org.apache.archiva.redback.authentication.AuthenticationException;
 import org.apache.archiva.redback.authentication.PasswordBasedAuthenticationDataSource;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.RbacObjectInvalidException;
-import org.codehaus.plexus.redback.rbac.UserAssignment;
+import org.apache.archiva.redback.rbac.RbacManagerException;
+import org.apache.archiva.redback.rbac.UserAssignment;
 import org.codehaus.plexus.redback.role.RoleManager;
 import org.codehaus.plexus.redback.struts2.action.AbstractUserCredentialsAction;
 import org.codehaus.plexus.redback.system.SecuritySession;
index bf319e3a6a611cf67c5b8da910e79cf4e3eb63ec..2c6a6ae0f26d9a6b6e7c3b3e66080c39ef4b787c 100644 (file)
@@ -23,12 +23,12 @@ import com.google.common.collect.Lists;
 import com.opensymphony.xwork2.Action;
 import com.opensymphony.xwork2.ActionProxy;
 import org.apache.archiva.redback.authentication.AuthenticationException;
+import org.apache.archiva.redback.rbac.RbacObjectInvalidException;
+import org.apache.archiva.redback.rbac.Role;
 import org.apache.archiva.redback.users.UserNotFoundException;
 import org.apache.archiva.redback.authorization.AuthorizationResult;
 import org.apache.archiva.redback.policy.AccountLockedException;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.RbacObjectInvalidException;
-import org.codehaus.plexus.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.RbacManagerException;
 import org.codehaus.plexus.redback.struts2.model.ApplicationRoleDetails;
 import org.codehaus.plexus.redback.struts2.model.ApplicationRoleDetails.RoleTableCell;
 import org.codehaus.redback.integration.interceptor.SecureActionBundle;
index 25c432ea729b6ad57af6876ffbc8c604de7eadd4..ff8d8f930153b49d4c89e250f0c0ed327972a439 100644 (file)
@@ -22,14 +22,14 @@ package org.codehaus.plexus.redback.struts2.action.admin;
 import com.opensymphony.xwork2.Action;
 import org.apache.archiva.redback.authentication.AuthenticationException;
 import org.apache.archiva.redback.policy.AccountLockedException;
+import org.apache.archiva.redback.rbac.RbacManagerException;
+import org.apache.archiva.redback.rbac.RbacObjectInvalidException;
+import org.apache.archiva.redback.rbac.Role;
 import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.users.UserNotFoundException;
 import org.apache.archiva.redback.authentication.AuthenticationResult;
 import org.apache.archiva.redback.policy.MustChangePasswordException;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.RbacObjectInvalidException;
-import org.codehaus.plexus.redback.rbac.RbacObjectNotFoundException;
-import org.codehaus.plexus.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.RbacObjectNotFoundException;
 import org.codehaus.plexus.redback.system.DefaultSecuritySession;
 import org.codehaus.plexus.redback.system.SecuritySession;
 import org.codehaus.plexus.redback.system.SecuritySystemConstants;
index d1773a5762e50774dded3093f4824547973784c1..91365c1f6566f0fcf8a05f715efe419a4b32c089 100644 (file)
 <component-set>
   <components>
     <component>
-      <role>org.codehaus.plexus.redback.rbac.RBACManager</role>
+      <role>org.apache.archiva.redback.rbac.RBACManager</role>
       <role-hint>cached</role-hint>
       <implementation>org.codehaus.plexus.redback.rbac.cached.CachedRbacManager</implementation>
       <description>CachedRbacManager is a wrapped RBACManager with caching.</description>
       <requirements>
         <requirement>
-          <role>org.codehaus.plexus.redback.rbac.RBACManager</role>
+          <role>org.apache.archiva.redback.rbac.RBACManager</role>
           <role-hint>memory</role-hint>
           <field-name>rbacImpl</field-name>
         </requirement>
index d1773a5762e50774dded3093f4824547973784c1..91365c1f6566f0fcf8a05f715efe419a4b32c089 100644 (file)
 <component-set>
   <components>
     <component>
-      <role>org.codehaus.plexus.redback.rbac.RBACManager</role>
+      <role>org.apache.archiva.redback.rbac.RBACManager</role>
       <role-hint>cached</role-hint>
       <implementation>org.codehaus.plexus.redback.rbac.cached.CachedRbacManager</implementation>
       <description>CachedRbacManager is a wrapped RBACManager with caching.</description>
       <requirements>
         <requirement>
-          <role>org.codehaus.plexus.redback.rbac.RBACManager</role>
+          <role>org.apache.archiva.redback.rbac.RBACManager</role>
           <role-hint>memory</role-hint>
           <field-name>rbacImpl</field-name>
         </requirement>
index fac9a773f5187574dcacbfbdfe88b450e5a21005..a438cb1d4e610ba6fbfcf2d94ab19c0a9ac0928f 100755 (executable)
   <!--
 
     <component>
-      <role>org.codehaus.plexus.redback.rbac.RBACManager</role>
+      <role>org.apache.archiva.redback.rbac.RBACManager</role>
       <role-hint>cached</role-hint>
       <implementation>org.codehaus.plexus.redback.rbac.cached.CachedRbacManager</implementation>
       <description>CachedRbacManager is a wrapped RBACManager with caching.</description>
       <requirements>
         <requirement>
-          <role>org.codehaus.plexus.redback.rbac.RBACManager</role>
+          <role>org.apache.archiva.redback.rbac.RBACManager</role>
           <role-hint>memory</role-hint>
           <field-name>rbacImpl</field-name>
         </requirement>
index ebf18202d874d9e29c4de31e1330c53e24a24d21..f39a219adae1dccbe110e8f6c8a5b024141f50e6 100644 (file)
@@ -19,6 +19,9 @@ package org.codehaus.plexus.redback.authorization.rbac;
  * under the License.
  */
 
+import org.apache.archiva.redback.rbac.Permission;
+import org.apache.archiva.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.RbacManagerException;
 import org.apache.archiva.redback.users.UserNotFoundException;
 import org.apache.archiva.redback.authorization.AuthorizationDataSource;
 import org.apache.archiva.redback.authorization.AuthorizationException;
@@ -27,10 +30,7 @@ import org.apache.archiva.redback.authorization.Authorizer;
 import org.apache.archiva.redback.authorization.NotAuthorizedException;
 import org.codehaus.plexus.redback.authorization.rbac.evaluator.PermissionEvaluationException;
 import org.codehaus.plexus.redback.authorization.rbac.evaluator.PermissionEvaluator;
-import org.codehaus.plexus.redback.rbac.Permission;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.RbacObjectNotFoundException;
+import org.apache.archiva.redback.rbac.RbacObjectNotFoundException;
 import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.users.UserManager;
 import org.slf4j.Logger;
index d6271bf41ff4228ae4549ac1cfe8f55ae5d39515..39ab53c818a00ad5a28fa757721cf634bda86005 100644 (file)
@@ -19,10 +19,10 @@ package org.codehaus.plexus.redback.authorization.rbac.evaluator;
  * under the License.
  */
 
+import org.apache.archiva.redback.rbac.Resource;
 import org.apache.archiva.redback.users.UserManager;
 import org.apache.archiva.redback.users.UserNotFoundException;
-import org.codehaus.plexus.redback.rbac.Permission;
-import org.codehaus.plexus.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.Permission;
 import org.springframework.stereotype.Service;
 
 import javax.inject.Inject;
index 539e10ffd63b4201803ddb1e794ad4b91cd20a98..d96636da69360f0f26c57399303904f5540a475b 100644 (file)
@@ -20,9 +20,9 @@ package org.codehaus.plexus.redback.authorization.rbac.evaluator;
  */
 
 import junit.framework.TestCase;
-import org.codehaus.plexus.redback.rbac.Operation;
-import org.codehaus.plexus.redback.rbac.Permission;
-import org.codehaus.plexus.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.Permission;
+import org.apache.archiva.redback.rbac.Operation;
+import org.apache.archiva.redback.rbac.Resource;
 import org.codehaus.plexus.redback.rbac.memory.MemoryOperation;
 import org.codehaus.plexus.redback.rbac.memory.MemoryPermission;
 import org.codehaus.plexus.redback.rbac.memory.MemoryResource;
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/AbstractRBACManager.java b/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/AbstractRBACManager.java
new file mode 100644 (file)
index 0000000..c90ac55
--- /dev/null
@@ -0,0 +1,795 @@
+package org.apache.archiva.redback.rbac;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.codehaus.plexus.util.CollectionUtils;
+import org.codehaus.plexus.util.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.annotation.PostConstruct;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * AbstractRBACManager
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public abstract class AbstractRBACManager
+    implements RBACManager
+{
+    protected Logger log = LoggerFactory.getLogger( getClass() );
+
+    private List<RBACManagerListener> listeners = new ArrayList<RBACManagerListener>( 0 );
+
+    private Resource globalResource;
+
+    @PostConstruct
+    public void initialize()
+    {
+        //no op
+    }
+
+    public void addListener( RBACManagerListener listener )
+    {
+        if ( !listeners.contains( listener ) )
+        {
+            listeners.add( listener );
+        }
+    }
+
+    public void removeListener( RBACManagerListener listener )
+    {
+        listeners.remove( listener );
+    }
+
+    public void fireRbacInit( boolean freshdb )
+    {
+        Iterator<RBACManagerListener> it = listeners.iterator();
+        while ( it.hasNext() )
+        {
+            RBACManagerListener listener = it.next();
+            try
+            {
+                listener.rbacInit( freshdb );
+            }
+            catch ( Exception e )
+            {
+                log.warn( "Unable to trigger .rbacInit( boolean ) to " + listener.getClass().getName(), e );
+            }
+        }
+    }
+
+    public void fireRbacRoleSaved( Role role )
+    {
+        Iterator<RBACManagerListener> it = listeners.iterator();
+        while ( it.hasNext() )
+        {
+            RBACManagerListener listener = it.next();
+            try
+            {
+                listener.rbacRoleSaved( role );
+            }
+            catch ( Exception e )
+            {
+                log.warn( "Unable to trigger .rbacRoleSaved( Role ) to " + listener.getClass().getName(), e );
+            }
+        }
+    }
+
+    public void fireRbacRoleRemoved( Role role )
+    {
+        Iterator<RBACManagerListener> it = listeners.iterator();
+        while ( it.hasNext() )
+        {
+            RBACManagerListener listener = it.next();
+            try
+            {
+                listener.rbacRoleRemoved( role );
+            }
+            catch ( Exception e )
+            {
+                log.warn( "Unable to trigger .rbacRoleRemoved( Role ) to " + listener.getClass().getName(), e );
+            }
+        }
+    }
+
+    public void fireRbacPermissionSaved( Permission permission )
+    {
+        Iterator<RBACManagerListener> it = listeners.iterator();
+        while ( it.hasNext() )
+        {
+            RBACManagerListener listener = it.next();
+            try
+            {
+                listener.rbacPermissionSaved( permission );
+            }
+            catch ( Exception e )
+            {
+                log.warn( "Unable to trigger .rbacPermissionSaved( Permission ) to " + listener.getClass().getName(),
+                          e );
+            }
+        }
+    }
+
+    public void fireRbacPermissionRemoved( Permission permission )
+    {
+        Iterator<RBACManagerListener> it = listeners.iterator();
+        while ( it.hasNext() )
+        {
+            RBACManagerListener listener = it.next();
+            try
+            {
+                listener.rbacPermissionRemoved( permission );
+            }
+            catch ( Exception e )
+            {
+                log.warn( "Unable to trigger .rbacPermissionRemoved( Permission ) to " + listener.getClass().getName(),
+                          e );
+            }
+        }
+    }
+
+    public void fireRbacUserAssignmentSaved( UserAssignment userAssignment )
+    {
+        Iterator<RBACManagerListener> it = listeners.iterator();
+        while ( it.hasNext() )
+        {
+            RBACManagerListener listener = it.next();
+            try
+            {
+                listener.rbacUserAssignmentSaved( userAssignment );
+            }
+            catch ( Exception e )
+            {
+                log.warn(
+                    "Unable to trigger .rbacUserAssignmentSaved( UserAssignment ) to " + listener.getClass().getName(),
+                    e );
+            }
+        }
+    }
+
+    public void fireRbacUserAssignmentRemoved( UserAssignment userAssignment )
+    {
+        Iterator<RBACManagerListener> it = listeners.iterator();
+        while ( it.hasNext() )
+        {
+            RBACManagerListener listener = it.next();
+            try
+            {
+                listener.rbacUserAssignmentRemoved( userAssignment );
+            }
+            catch ( Exception e )
+            {
+                log.warn( "Unable to trigger .rbacUserAssignmentRemoved( UserAssignment ) to "
+                              + listener.getClass().getName(), e );
+            }
+        }
+    }
+
+    public void removeRole( String roleName )
+        throws RbacObjectNotFoundException, RbacManagerException
+    {
+        removeRole( getRole( roleName ) );
+    }
+
+    public void removePermission( String permissionName )
+        throws RbacObjectNotFoundException, RbacManagerException
+    {
+        removePermission( getPermission( permissionName ) );
+    }
+
+    public void removeOperation( String operationName )
+        throws RbacObjectNotFoundException, RbacManagerException
+    {
+        removeOperation( getOperation( operationName ) );
+    }
+
+    public void removeResource( String resourceIdentifier )
+        throws RbacObjectNotFoundException, RbacManagerException
+    {
+        removeResource( getResource( resourceIdentifier ) );
+    }
+
+    public void removeUserAssignment( String principal )
+        throws RbacObjectNotFoundException, RbacManagerException
+    {
+        removeUserAssignment( getUserAssignment( principal ) );
+    }
+
+    public boolean resourceExists( Resource resource )
+    {
+        try
+        {
+            return getAllResources().contains( resource );
+        }
+        catch ( RbacManagerException e )
+        {
+            return false;
+        }
+    }
+
+    public boolean resourceExists( String identifier )
+    {
+        try
+        {
+            for ( Resource resource : getAllResources() )
+            {
+                if ( StringUtils.equals( resource.getIdentifier(), identifier ) )
+                {
+                    return true;
+                }
+            }
+        }
+        catch ( RbacManagerException e )
+        {
+            return false;
+        }
+
+        return false;
+    }
+
+    public boolean operationExists( Operation operation )
+    {
+        try
+        {
+            return getAllOperations().contains( operation );
+        }
+        catch ( RbacManagerException e )
+        {
+            return false;
+        }
+    }
+
+    public boolean operationExists( String name )
+    {
+        try
+        {
+            for ( Operation operation : getAllOperations() )
+            {
+                if ( StringUtils.equals( operation.getName(), name ) )
+                {
+                    return true;
+                }
+            }
+        }
+        catch ( RbacManagerException e )
+        {
+            return false;
+        }
+
+        return false;
+    }
+
+    public boolean permissionExists( Permission permission )
+    {
+        try
+        {
+            return getAllPermissions().contains( permission );
+        }
+        catch ( RbacManagerException e )
+        {
+            return false;
+        }
+    }
+
+    public boolean permissionExists( String name )
+    {
+        try
+        {
+            for ( Permission permission : getAllPermissions() )
+            {
+                if ( StringUtils.equals( permission.getName(), name ) )
+                {
+                    return true;
+                }
+            }
+        }
+        catch ( RbacManagerException e )
+        {
+            return false;
+        }
+
+        return false;
+    }
+
+    public boolean roleExists( Role role )
+    {
+        try
+        {
+            return getAllRoles().contains( role );
+        }
+        catch ( RbacManagerException e )
+        {
+            return false;
+        }
+    }
+
+    public boolean roleExists( String name )
+    {
+        try
+        {
+            for ( Role role : getAllRoles() )
+            {
+                if ( StringUtils.equals( role.getName(), name ) )
+                {
+                    return true;
+                }
+            }
+        }
+        catch ( RbacManagerException e )
+        {
+            return false;
+        }
+
+        return false;
+    }
+
+    public boolean userAssignmentExists( String principal )
+    {
+        try
+        {
+            for ( UserAssignment assignment : getAllUserAssignments() )
+            {
+                if ( StringUtils.equals( assignment.getPrincipal(), principal ) )
+                {
+                    return true;
+                }
+            }
+        }
+        catch ( RbacManagerException e )
+        {
+            return false;
+        }
+
+        return false;
+    }
+
+    public boolean userAssignmentExists( UserAssignment assignment )
+    {
+        try
+        {
+            return getAllUserAssignments().contains( assignment );
+        }
+        catch ( RbacManagerException e )
+        {
+            return false;
+        }
+    }
+
+    /**
+     * returns a set of all permissions that are in all active roles for a given
+     * principal
+     *
+     * @param principal
+     * @return
+     * @throws RbacObjectNotFoundException
+     * @throws RbacManagerException
+     */
+    public Set<Permission> getAssignedPermissions( String principal )
+        throws RbacObjectNotFoundException, RbacManagerException
+    {
+
+        UserAssignment ua = getUserAssignment( principal );
+
+        Set<Permission> permissionSet = new HashSet<Permission>();
+
+        if ( ua.getRoleNames() != null )
+        {
+            boolean childRoleNamesUpdated = false;
+
+            Iterator<String> it = ua.getRoleNames().listIterator();
+            while ( it.hasNext() )
+            {
+                String roleName = it.next();
+                try
+                {
+                    Role role = getRole( roleName );
+                    gatherUniquePermissions( role, permissionSet );
+                }
+                catch ( RbacObjectNotFoundException e )
+                {
+                    // Found a bad role name. remove it!
+                    it.remove();
+                    childRoleNamesUpdated = true;
+                }
+            }
+
+            if ( childRoleNamesUpdated )
+            {
+                saveUserAssignment( ua );
+            }
+        }
+
+        return permissionSet;
+    }
+
+    /**
+     * returns a map of assigned permissions keyed off of operations
+     *
+     * @param principal
+     * @return
+     * @throws RbacObjectNotFoundException
+     * @throws RbacManagerException
+     */
+    public Map<String, List<Permission>> getAssignedPermissionMap( String principal )
+        throws RbacObjectNotFoundException, RbacManagerException
+    {
+        return getPermissionMapByOperation( getAssignedPermissions( principal ) );
+    }
+
+    private Map<String, List<Permission>> getPermissionMapByOperation( Collection<Permission> permissions )
+    {
+        Map<String, List<Permission>> userPermMap = new HashMap<String, List<Permission>>();
+
+        for ( Permission permission : permissions )
+        {
+            List<Permission> permList = userPermMap.get( permission.getOperation().getName() );
+
+            if ( permList != null )
+            {
+                permList.add( permission );
+            }
+            else
+            {
+                List<Permission> newPermList = new ArrayList<Permission>( permissions.size() );
+                newPermList.add( permission );
+                userPermMap.put( permission.getOperation().getName(), newPermList );
+            }
+        }
+
+        return userPermMap;
+    }
+
+    private void gatherUniquePermissions( Role role, Collection<Permission> coll )
+        throws RbacManagerException
+    {
+        if ( role.getPermissions() != null )
+        {
+            for ( Permission permission : role.getPermissions() )
+            {
+                if ( !coll.contains( permission ) )
+                {
+                    coll.add( permission );
+                }
+            }
+        }
+
+        if ( role.hasChildRoles() )
+        {
+            Map<String, Role> childRoles = getChildRoles( role );
+            Iterator<Role> it = childRoles.values().iterator();
+            while ( it.hasNext() )
+            {
+                Role child = it.next();
+                gatherUniquePermissions( child, coll );
+            }
+        }
+    }
+
+    public List<Role> getAllAssignableRoles()
+        throws RbacManagerException, RbacObjectNotFoundException
+    {
+        List<Role> assignableRoles = new ArrayList<Role>();
+
+        for ( Role r : getAllRoles() )
+        {
+            Role role = getRole( r.getName() );
+            if ( role.isAssignable() )
+            {
+                assignableRoles.add( role );
+            }
+        }
+
+        return assignableRoles;
+    }
+
+    /**
+     * returns the active roles for a given principal
+     * <p/>
+     * NOTE: roles that are returned might have have roles themselves, if
+     * you just want all permissions then use {@link #getAssignedPermissions(String principal)}
+     *
+     * @param principal
+     * @return
+     * @throws RbacObjectNotFoundException
+     * @throws RbacManagerException
+     */
+    public Collection<Role> getAssignedRoles( String principal )
+        throws RbacObjectNotFoundException, RbacManagerException
+    {
+        UserAssignment ua = getUserAssignment( principal );
+
+        return getAssignedRoles( ua );
+    }
+
+    /**
+     * returns only the roles that are assigned, not the roles that might be child roles of the
+     * assigned roles.
+     *
+     * @param ua
+     * @return
+     * @throws RbacObjectNotFoundException
+     * @throws RbacManagerException
+     */
+    public Collection<Role> getAssignedRoles( UserAssignment ua )
+        throws RbacObjectNotFoundException, RbacManagerException
+    {
+        Set<Role> roleSet = new HashSet<Role>();
+
+        if ( ua.getRoleNames() != null )
+        {
+            boolean childRoleNamesUpdated = false;
+
+            Iterator<String> it = ua.getRoleNames().listIterator();
+            while ( it.hasNext() )
+            {
+                String roleName = it.next();
+                try
+                {
+                    Role role = getRole( roleName );
+
+                    if ( !roleSet.contains( role ) )
+                    {
+                        roleSet.add( role );
+                    }
+                }
+                catch ( RbacObjectNotFoundException e )
+                {
+                    // Found a bad role name. remove it!
+                    it.remove();
+                    childRoleNamesUpdated = true;
+                }
+            }
+
+            if ( childRoleNamesUpdated )
+            {
+                saveUserAssignment( ua );
+            }
+        }
+
+        return roleSet;
+    }
+
+    /**
+     * get all of the roles that the give role has as a child into a set
+     *
+     * @param role
+     * @param roleSet
+     * @throws RbacObjectNotFoundException
+     * @throws RbacManagerException
+     */
+    private void gatherEffectiveRoles( Role role, Set<Role> roleSet )
+        throws RbacObjectNotFoundException, RbacManagerException
+    {
+        if ( role.hasChildRoles() )
+        {
+            for ( String roleName : role.getChildRoleNames() )
+            {
+                try
+                {
+                    Role crole = getRole( roleName );
+
+                    if ( !roleSet.contains( crole ) )
+                    {
+                        gatherEffectiveRoles( crole, roleSet );
+                    }
+                }
+                catch ( RbacObjectNotFoundException e )
+                {
+                    // the client application might not manage role clean up totally correctly so we want to notify
+                    // of a child role issue and offer a clean up process at some point
+                    log.warn( "dangling child role: " + roleName + " on " + role.getName() );
+                }
+            }
+        }
+
+        if ( !roleSet.contains( role ) )
+        {
+            roleSet.add( role );
+        }
+    }
+
+    public Collection<Role> getEffectivelyAssignedRoles( String principal )
+        throws RbacObjectNotFoundException, RbacManagerException
+    {
+        UserAssignment ua = getUserAssignment( principal );
+
+        return getEffectivelyAssignedRoles( ua );
+    }
+
+    public Collection<Role> getEffectivelyAssignedRoles( UserAssignment ua )
+        throws RbacObjectNotFoundException, RbacManagerException
+    {
+        Set<Role> roleSet = new HashSet<Role>();
+
+        if ( ua != null && ua.getRoleNames() != null )
+        {
+            boolean childRoleNamesUpdated = false;
+
+            Iterator<String> it = ua.getRoleNames().listIterator();
+            while ( it.hasNext() )
+            {
+                String roleName = it.next();
+                try
+                {
+                    Role role = getRole( roleName );
+
+                    gatherEffectiveRoles( role, roleSet );
+                }
+                catch ( RbacObjectNotFoundException e )
+                {
+                    // Found a bad role name. remove it!
+                    it.remove();
+                    childRoleNamesUpdated = true;
+                }
+            }
+
+            if ( childRoleNamesUpdated )
+            {
+                saveUserAssignment( ua );
+            }
+        }
+        return roleSet;
+    }
+
+    /**
+     * @param principal
+     * @return
+     * @throws RbacManagerException
+     * @throws RbacObjectNotFoundException
+     */
+    @SuppressWarnings( "unchecked" )
+    public Collection<Role> getEffectivelyUnassignedRoles( String principal )
+        throws RbacManagerException, RbacObjectNotFoundException
+    {
+        Collection<Role> assignedRoles = getEffectivelyAssignedRoles( principal );
+        List<Role> allRoles = getAllAssignableRoles();
+
+        log.debug( "UR: assigned {}", assignedRoles.size() );
+        log.debug( "UR: available {}", allRoles.size() );
+
+        return CollectionUtils.subtract( allRoles, assignedRoles );
+    }
+
+
+    /**
+     * @param principal
+     * @return
+     * @throws RbacManagerException
+     * @throws RbacObjectNotFoundException
+     */
+    @SuppressWarnings( "unchecked" )
+    public Collection<Role> getUnassignedRoles( String principal )
+        throws RbacManagerException, RbacObjectNotFoundException
+    {
+        Collection<Role> assignedRoles = getAssignedRoles( principal );
+        List<Role> allRoles = getAllAssignableRoles();
+
+        log.debug( "UR: assigned {}", assignedRoles.size() );
+        log.debug( "UR: available {}", allRoles.size() );
+
+        return CollectionUtils.subtract( allRoles, assignedRoles );
+    }
+
+    public Resource getGlobalResource()
+        throws RbacManagerException
+    {
+        if ( globalResource == null )
+        {
+            globalResource = createResource( Resource.GLOBAL );
+            globalResource.setPermanent( true );
+            globalResource = saveResource( globalResource );
+        }
+        return globalResource;
+    }
+
+    public void addChildRole( Role role, Role childRole )
+        throws RbacObjectInvalidException, RbacManagerException
+    {
+        saveRole( childRole );
+        role.addChildRoleName( childRole.getName() );
+    }
+
+    public Map<String, Role> getChildRoles( Role role )
+        throws RbacManagerException
+    {
+        Map<String, Role> childRoles = new HashMap<String, Role>();
+
+        boolean childRoleNamesUpdated = false;
+
+        Iterator<String> it = role.getChildRoleNames().listIterator();
+        while ( it.hasNext() )
+        {
+            String roleName = (String) it.next();
+            try
+            {
+                Role child = getRole( roleName );
+                childRoles.put( child.getName(), child );
+            }
+            catch ( RbacObjectNotFoundException e )
+            {
+                // Found a bad roleName! - remove it.
+                it.remove();
+                childRoleNamesUpdated = true;
+            }
+        }
+
+        if ( childRoleNamesUpdated )
+        {
+            saveRole( role );
+        }
+
+        return childRoles;
+    }
+
+    public Map<String, Role> getParentRoles( Role role )
+        throws RbacManagerException
+    {
+        Map<String, Role> parentRoles = new HashMap<String, Role>();
+
+        for ( Role r : getAllRoles() )
+        {
+            if ( !r.getName().equals( role.getName() ) )
+            {
+                Set<Role> effectiveRoles = getEffectiveRoles( r );
+                for ( Role currentRole : effectiveRoles )
+                {
+                    if ( currentRole.getName().equals( role.getName() ) )
+                    {
+                        if ( !parentRoles.containsKey( r.getName() ) )
+                        {
+                            parentRoles.put( r.getName(), r );
+                        }
+                    }
+                }
+            }
+        }
+        return parentRoles;
+    }
+
+    public Set<Role> getEffectiveRoles( Role role )
+        throws RbacObjectNotFoundException, RbacManagerException
+    {
+        Set<Role> roleSet = new HashSet<Role>();
+        gatherEffectiveRoles( role, roleSet );
+
+        return roleSet;
+    }
+
+    public Map<String, Role> getRoles( Collection<String> roleNames )
+        throws RbacObjectNotFoundException, RbacManagerException
+    {
+        Map<String, Role> roleMap = new HashMap<String, Role>();
+
+        for ( String roleName : roleNames )
+        {
+            Role child = getRole( roleName );
+            roleMap.put( child.getName(), child );
+        }
+
+        return roleMap;
+    }
+}
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/AbstractRole.java b/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/AbstractRole.java
new file mode 100644 (file)
index 0000000..97a7439
--- /dev/null
@@ -0,0 +1,33 @@
+package org.apache.archiva.redback.rbac;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * AbstractRole useful for common logic that implementors can use. 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public abstract class AbstractRole
+    implements Role
+{
+
+    public boolean hasChildRoles()
+    {
+        return ( getChildRoleNames() != null ) && !getChildRoleNames().isEmpty();
+    }
+}
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/AbstractUserAssignment.java b/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/AbstractUserAssignment.java
new file mode 100644 (file)
index 0000000..375a09e
--- /dev/null
@@ -0,0 +1,55 @@
+package org.apache.archiva.redback.rbac;
+
+import java.util.List;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * AbstractUserAssignment useful for common logic that implementors can use. 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public abstract class AbstractUserAssignment
+    implements UserAssignment
+{
+
+    public void addRoleName( Role role )
+    {
+        addRoleName( role.getName() );
+    }
+
+    public void addRoleName( String roleName )
+    {
+        List<String> names = getRoleNames();
+        if ( !names.contains( roleName ) )
+        {
+            names.add( roleName );
+        }
+        setRoleNames( names );
+    }
+
+    public void removeRoleName( Role role )
+    {
+        removeRoleName( role.getName() );
+    }
+
+    public void removeRoleName( String roleName )
+    {
+        getRoleNames().remove( roleName );
+    }
+}
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/Operation.java b/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/Operation.java
new file mode 100644 (file)
index 0000000..14a4c6f
--- /dev/null
@@ -0,0 +1,81 @@
+package org.apache.archiva.redback.rbac;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Operation
+ * <p/>
+ * In RBAC the operation is an action or functionality that can be linked with a
+ * particular resource into an assignable Permission.  Operations don't exist outside
+ * Permissions.
+ *
+ * @author Jesse McConnell <jmcconnell@apache.org>
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public interface Operation
+{
+
+
+    /**
+     * Long description of an operation.
+     *
+     * @return String
+     */
+    String getDescription();
+
+    /**
+     * name of the operation that is used in the act of authorization
+     * <p/>
+     * 'modify-foo', 'change-password'
+     * <p/>
+     * NOTE: This field is considered the Primary Key for this object.
+     *
+     * @return the name of the operation.
+     */
+    String getName();
+
+    /**
+     * @param description
+     */
+    void setDescription( String description );
+
+    /**
+     * Set name of the operation that is used in the act of authorization
+     * <p/>
+     * 'modify-foo', 'change-password'
+     * <p/>
+     * NOTE: This field is considered the Primary Key for this object.
+     *
+     * @param name
+     */
+    void setName( String name );
+
+    /**
+     * Test to see if the object is a permanent object or not.
+     *
+     * @return true if the object is permanent.
+     */
+    boolean isPermanent();
+
+    /**
+     * Set flag indicating if the object is a permanent object or not.
+     *
+     * @param permanent true if the object is permanent.
+     */
+    void setPermanent( boolean permanent );
+}
\ No newline at end of file
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/Permission.java b/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/Permission.java
new file mode 100644 (file)
index 0000000..eaba55d
--- /dev/null
@@ -0,0 +1,101 @@
+package org.apache.archiva.redback.rbac;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Permission
+ * <p/>
+ * A permission is the wrapper for an operation and a resource effectively saying
+ * that the operation is authorized for that resource.
+ * <p/>
+ * P(Operation, Resource)
+ *
+ * @author Jesse McConnell <jmcconnell@apache.org>
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public interface Permission
+{
+
+    /**
+     * Long description of the Permission
+     */
+    String getDescription();
+
+    /**
+     * Get the short name of the permission.
+     * <p/>
+     * NOTE: This field is considered the Primary Key for this object.
+     *
+     * @return the short name for this permission.
+     */
+    String getName();
+
+    /**
+     * Operation that this permission is authorizing
+     */
+    Operation getOperation();
+
+    /**
+     * This is the resource associated with this permission.
+     * <p/>
+     * Implementors must always supply a Resource.
+     *
+     * @return the Resource.
+     */
+    Resource getResource();
+
+    /**
+     * Set null
+     *
+     * @param description
+     */
+    void setDescription( String description );
+
+    /**
+     * Set the short name for this permission.
+     *
+     * @param name
+     */
+    void setName( String name );
+
+    /**
+     * Set null
+     *
+     * @param operation
+     */
+    void setOperation( Operation operation );
+
+    /**
+     * @param resource
+     */
+    void setResource( Resource resource );
+
+    /**
+     * Test to see if the object is a permanent object or not.
+     *
+     * @return true if the object is permanent.
+     */
+    boolean isPermanent();
+
+    /**
+     * Set flag indicating if the object is a permanent object or not.
+     *
+     * @param permanent true if the object is permanent.
+     */
+    void setPermanent( boolean permanent );
+}
\ No newline at end of file
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/RBACManager.java b/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/RBACManager.java
new file mode 100644 (file)
index 0000000..15f4cbc
--- /dev/null
@@ -0,0 +1,424 @@
+package org.apache.archiva.redback.rbac;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * RBACManager
+ *
+ * @author Jesse McConnell <jmcconnell@apache.org>
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ * @todo expand on javadoc
+ */
+public interface RBACManager
+{
+
+    void addListener( RBACManagerListener listener );
+
+    void removeListener( RBACManagerListener listener );
+
+    // ------------------------------------------------------------------
+    // Role Methods
+    // ------------------------------------------------------------------
+
+    /**
+     * Creates an implementation specific {@link Role}, or return an existing {@link Role}, depending
+     * on the provided <code>name</code> parameter.
+     * <p/>
+     * Note: Be sure to use {@link #saveRole(Role)} in order to persist any changes to the Role.
+     *
+     * @param name the name.
+     * @return the new {@link Role} object.
+     */
+    Role createRole( String name );
+
+    /**
+     * Tests for the existence of a Role.
+     *
+     * @return true if role exists in store.
+     * @throws RbacManagerException
+     */
+    boolean roleExists( String name );
+
+    boolean roleExists( Role role );
+
+    Role saveRole( Role role )
+        throws RbacObjectInvalidException, RbacManagerException;
+
+    void saveRoles( Collection<Role> roles )
+        throws RbacObjectInvalidException, RbacManagerException;
+
+    /**
+     * @param roleName
+     * @return
+     * @throws RbacObjectNotFoundException
+     * @throws RbacManagerException
+     */
+    Role getRole( String roleName )
+        throws RbacObjectNotFoundException, RbacManagerException;
+
+    Map<String, Role> getRoles( Collection<String> roleNames )
+        throws RbacObjectNotFoundException, RbacManagerException;
+
+    void addChildRole( Role role, Role childRole )
+        throws RbacObjectInvalidException, RbacManagerException;
+
+    Map<String, Role> getChildRoles( Role role )
+        throws RbacManagerException;
+
+    Map<String, Role> getParentRoles( Role role )
+        throws RbacManagerException;
+
+    /**
+     * Method getRoles
+     */
+    List<Role> getAllRoles()
+        throws RbacManagerException;
+
+    /**
+     * Method getEffectiveRoles
+     */
+    Set<Role> getEffectiveRoles( Role role )
+        throws RbacObjectNotFoundException, RbacManagerException;
+
+    /**
+     * Method removeRole
+     *
+     * @param role
+     */
+    void removeRole( Role role )
+        throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException;
+
+    /**
+     * Method removeRole
+     *
+     * @param roleName
+     */
+    void removeRole( String roleName )
+        throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException;
+
+    // ------------------------------------------------------------------
+    // Permission Methods
+    // ------------------------------------------------------------------
+
+    /**
+     * Creates an implementation specific {@link Permission}, or return an existing {@link Permission}, depending
+     * on the provided <code>name</code> parameter.
+     * <p/>
+     * Note: Be sure to use {@link #savePermission(Permission)} in order to persist any changes to the Role.
+     *
+     * @param name the name.
+     * @return the new Permission.
+     * @throws RbacManagerException
+     */
+    Permission createPermission( String name )
+        throws RbacManagerException;
+
+    /**
+     * Creates an implementation specific {@link Permission} with specified {@link Operation},
+     * and {@link Resource} identifiers.
+     * <p/>
+     * Note: Be sure to use {@link #savePermission(Permission)} in order to persist any changes to the Role.
+     *
+     * @param name               the name.
+     * @param operationName      the {@link Operation#setName(String)} value
+     * @param resourceIdentifier the {@link Resource#setIdentifier(String)} value
+     * @return the new Permission.
+     * @throws RbacManagerException
+     */
+    Permission createPermission( String name, String operationName, String resourceIdentifier )
+        throws RbacManagerException;
+
+    /**
+     * Tests for the existence of a permission.
+     *
+     * @param name the name to test for.
+     * @return true if permission exists.
+     * @throws RbacManagerException
+     */
+    boolean permissionExists( String name );
+
+    boolean permissionExists( Permission permission );
+
+    Permission savePermission( Permission permission )
+        throws RbacObjectInvalidException, RbacManagerException;
+
+    Permission getPermission( String permissionName )
+        throws RbacObjectNotFoundException, RbacManagerException;
+
+    List<Permission> getAllPermissions()
+        throws RbacManagerException;
+
+    void removePermission( Permission permission )
+        throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException;
+
+    void removePermission( String permissionName )
+        throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException;
+
+    // ------------------------------------------------------------------
+    // Operation Methods
+    // ------------------------------------------------------------------
+
+    /**
+     * Creates an implementation specific {@link Operation}, or return an existing {@link Operation}, depending
+     * on the provided <code>name</code> parameter.
+     * <p/>
+     * Note: Be sure to use {@link #saveOperation(Operation)} in order to persist any changes to the Role.
+     *
+     * @param name the name.
+     * @return the new Operation.
+     * @throws RbacManagerException
+     */
+    Operation createOperation( String name )
+        throws RbacManagerException;
+
+    boolean operationExists( String name );
+
+    boolean operationExists( Operation operation );
+
+    /**
+     * Save the new or existing operation to the store.
+     *
+     * @param operation the operation to save (new or existing)
+     * @return the Operation that was saved.
+     * @throws RbacObjectInvalidException
+     * @throws RbacManagerException
+     */
+    Operation saveOperation( Operation operation )
+        throws RbacObjectInvalidException, RbacManagerException;
+
+    Operation getOperation( String operationName )
+        throws RbacObjectNotFoundException, RbacManagerException;
+
+    List<Operation> getAllOperations()
+        throws RbacManagerException;
+
+    void removeOperation( Operation operation )
+        throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException;
+
+    void removeOperation( String operationName )
+        throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException;
+
+    // ------------------------------------------------------------------
+    // Resource Methods
+    // ------------------------------------------------------------------
+
+    /**
+     * Creates an implementation specific {@link Resource}, or return an existing {@link Resource}, depending
+     * on the provided <code>identifier</code> parameter.
+     * <p/>
+     * Note: Be sure to use {@link #saveResource(Resource)} in order to persist any changes to the Role.
+     *
+     * @param identifier the identifier.
+     * @return the new Resource.
+     * @throws RbacManagerException
+     */
+    Resource createResource( String identifier )
+        throws RbacManagerException;
+
+    boolean resourceExists( String identifier );
+
+    boolean resourceExists( Resource resource );
+
+    Resource saveResource( Resource resource )
+        throws RbacObjectInvalidException, RbacManagerException;
+
+    Resource getResource( String resourceIdentifier )
+        throws RbacObjectNotFoundException, RbacManagerException;
+
+    List<Resource> getAllResources()
+        throws RbacManagerException;
+
+    void removeResource( Resource resource )
+        throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException;
+
+    void removeResource( String resourceIdentifier )
+        throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException;
+
+    // ------------------------------------------------------------------
+    // UserAssignment Methods
+    // ------------------------------------------------------------------
+
+    /**
+     * Creates an implementation specific {@link UserAssignment}, or return an existing {@link UserAssignment},
+     * depending on the provided <code>identifier</code> parameter.
+     * <p/>
+     * Note: Be sure to use {@link #saveUserAssignment(UserAssignment)} in order to persist any changes to the Role.
+     *
+     * @param principal the principal reference to the user.
+     * @return the new UserAssignment object.
+     * @throws RbacManagerException
+     */
+    UserAssignment createUserAssignment( String principal )
+        throws RbacManagerException;
+
+    boolean userAssignmentExists( String principal );
+
+    boolean userAssignmentExists( UserAssignment assignment );
+
+    /**
+     * Method saveUserAssignment
+     *
+     * @param userAssignment
+     */
+    UserAssignment saveUserAssignment( UserAssignment userAssignment )
+        throws RbacObjectInvalidException, RbacManagerException;
+
+    UserAssignment getUserAssignment( String principal )
+        throws RbacObjectNotFoundException, RbacManagerException;
+
+    /**
+     * Method getAssignments
+     */
+    List<UserAssignment> getAllUserAssignments()
+        throws RbacManagerException;
+
+    /**
+     * Method getUserAssignmentsForRoless
+     */
+    List<UserAssignment> getUserAssignmentsForRoles( Collection<String> roleNames )
+        throws RbacManagerException;
+
+    /**
+     * Method removeAssignment
+     *
+     * @param userAssignment
+     */
+    void removeUserAssignment( UserAssignment userAssignment )
+        throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException;
+
+    /**
+     * Method removeAssignment
+     *
+     * @param principal
+     */
+    void removeUserAssignment( String principal )
+        throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException;
+
+    // ------------------------------------------------------------------
+    // UserAssignment Utility Methods
+    // ------------------------------------------------------------------
+
+    /**
+     * returns the active roles for a given principal
+     * <p/>
+     * NOTE: roles that are returned might have have roles themselves, if
+     * you just want all permissions then use {@link #getAssignedPermissions(String principal)}
+     *
+     * @param principal
+     * @return Collection of {@link Role} objects.
+     * @throws RbacObjectNotFoundException
+     * @throws RbacManagerException
+     */
+    Collection<Role> getAssignedRoles( String principal )
+        throws RbacObjectNotFoundException, RbacManagerException;
+
+    /**
+     * Get the Collection of {@link Role} objects for this UserAssignment.
+     *
+     * @param userAssignment
+     * @return Collection of {@link Role} objects for the provided UserAssignment.
+     */
+    Collection<Role> getAssignedRoles( UserAssignment userAssignment )
+        throws RbacObjectNotFoundException, RbacManagerException;
+
+    /**
+     * Get a list of all assignable roles that are currently not effectively assigned to the specific user,
+     * meaning, not a child of any already granted role
+     *
+     * @param principal
+     * @return
+     * @throws RbacManagerException
+     * @throws RbacObjectNotFoundException
+     */
+    Collection<Role> getEffectivelyUnassignedRoles( String principal )
+        throws RbacManagerException, RbacObjectNotFoundException;
+
+    /**
+     * Get a list of the effectively assigned roles to the specified user, this includes child roles
+     *
+     * @param principal
+     * @return
+     * @throws RbacObjectNotFoundException
+     * @throws RbacManagerException
+     */
+    Collection<Role> getEffectivelyAssignedRoles( String principal )
+        throws RbacObjectNotFoundException, RbacManagerException;
+
+    /**
+     * Get a list of all assignable roles that are currently not assigned to the specific user.
+     *
+     * @param principal
+     * @return
+     * @throws RbacManagerException
+     * @throws RbacObjectNotFoundException
+     */
+    Collection<Role> getUnassignedRoles( String principal )
+        throws RbacManagerException, RbacObjectNotFoundException;
+
+    /**
+     * returns a set of all permissions that are in all active roles for a given
+     * principal
+     *
+     * @param principal
+     * @return
+     * @throws RbacObjectNotFoundException
+     * @throws RbacManagerException
+     */
+    Set<Permission> getAssignedPermissions( String principal )
+        throws RbacObjectNotFoundException, RbacManagerException;
+
+    /**
+     * returns a map of assigned permissions keyed off of operation with a list value of Permissions
+     *
+     * @param principal
+     * @return
+     * @throws RbacObjectNotFoundException
+     * @throws RbacManagerException
+     */
+    Map<String, List<Permission>> getAssignedPermissionMap( String principal )
+        throws RbacObjectNotFoundException, RbacManagerException;
+
+    /**
+     * returns a list of all assignable roles
+     *
+     * @return
+     * @throws RbacManagerException
+     * @throws RbacObjectNotFoundException
+     */
+    List<Role> getAllAssignableRoles()
+        throws RbacManagerException, RbacObjectNotFoundException;
+
+    /**
+     * returns the global resource object
+     *
+     * @return
+     * @throws RbacManagerException
+     */
+    Resource getGlobalResource()
+        throws RbacManagerException;
+
+    void eraseDatabase();
+}
\ No newline at end of file
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/RBACManagerListener.java b/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/RBACManagerListener.java
new file mode 100644 (file)
index 0000000..77ed070
--- /dev/null
@@ -0,0 +1,43 @@
+package org.apache.archiva.redback.rbac;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * RBACManagerListener 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public interface RBACManagerListener
+{
+    public void rbacInit( boolean freshdb );
+
+    public void rbacRoleSaved( Role role );
+
+    public void rbacRoleRemoved( Role role );
+
+    public void rbacPermissionSaved( Permission permission );
+
+    public void rbacPermissionRemoved( Permission permission );
+
+    public void rbacUserAssignmentSaved( UserAssignment userAssignment );
+
+    public void rbacUserAssignmentRemoved( UserAssignment userAssignment );
+}
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/RBACObjectAssertions.java b/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/RBACObjectAssertions.java
new file mode 100644 (file)
index 0000000..d8fac1c
--- /dev/null
@@ -0,0 +1,165 @@
+package org.apache.archiva.redback.rbac;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.codehaus.plexus.util.StringUtils;
+
+/**
+ * RBACObjectAssertions 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class RBACObjectAssertions
+{
+    public static void assertValid( Role role )
+        throws RbacObjectInvalidException
+    {
+        assertValid( null, role );
+    }
+
+    public static void assertValid( String scope, Role role )
+        throws RbacObjectInvalidException
+    {
+        if ( role == null )
+        {
+            throw new RbacObjectInvalidException( scope, "Null Role object is invalid." );
+        }
+
+        if ( StringUtils.isEmpty( role.getName() ) )
+        {
+            throw new RbacObjectInvalidException( scope, "Role.name must not be empty." );
+        }
+
+        if ( role.getPermissions() != null )
+        {
+            int i = 0;
+            for ( Permission perm : role.getPermissions() )
+            {
+                assertValid( "Role.permissions[" + i + "]", perm );
+                i++;
+            }
+        }
+    }
+
+    public static void assertValid( Permission permission )
+        throws RbacObjectInvalidException
+    {
+        assertValid( null, permission );
+    }
+
+    public static void assertValid( String scope, Permission permission )
+        throws RbacObjectInvalidException
+    {
+        if ( permission == null )
+        {
+            throw new RbacObjectInvalidException( scope, "Null Permission object is invalid." );
+        }
+
+        if ( StringUtils.isEmpty( permission.getName() ) )
+        {
+            throw new RbacObjectInvalidException( scope, "Permission.name must not be empty." );
+        }
+
+        assertValid( "Permission.operation", permission.getOperation() );
+        assertValid( "Permission.resource", permission.getResource() );
+
+    }
+
+    public static void assertValid( Operation operation )
+        throws RbacObjectInvalidException
+    {
+        assertValid( null, operation );
+    }
+
+    public static void assertValid( String scope, Operation operation )
+        throws RbacObjectInvalidException
+    {
+        if ( operation == null )
+        {
+            throw new RbacObjectInvalidException( scope, "Null Operation object is invalid." );
+        }
+
+        if ( StringUtils.isEmpty( operation.getName() ) )
+        {
+            throw new RbacObjectInvalidException( scope, "Operation.name must not be empty." );
+        }
+    }
+
+    public static void assertValid( Resource resource )
+        throws RbacObjectInvalidException
+    {
+        assertValid( null, resource );
+    }
+
+    public static void assertValid( String scope, Resource resource )
+        throws RbacObjectInvalidException
+    {
+        if ( resource == null )
+        {
+            throw new RbacObjectInvalidException( scope, "Null Resource object is invalid." );
+        }
+
+        if ( StringUtils.isEmpty( resource.getIdentifier() ) )
+        {
+            throw new RbacObjectInvalidException( scope, "Resource.identifier must not be empty." );
+        }
+    }
+
+    public static void assertValid( UserAssignment assignment )
+        throws RbacObjectInvalidException
+    {
+        assertValid( null, assignment );
+    }
+
+    public static void assertValid( String scope, UserAssignment assignment )
+        throws RbacObjectInvalidException
+    {
+        if ( assignment == null )
+        {
+            throw new RbacObjectInvalidException( scope, "Null UserAssigment object is invalid." );
+        }
+
+        if ( StringUtils.isEmpty( assignment.getPrincipal() ) )
+        {
+            throw new RbacObjectInvalidException( scope, "UserAssigment.principal cannot be empty." );
+        }
+
+        if ( assignment.getRoleNames() == null )
+        {
+            throw new RbacObjectInvalidException( scope, "UserAssignment.roles cannot be null." );
+        }
+
+        /*  I don't believe this assertion is valid, a person should be able to be stripped of all roles.
+           -- jesse
+        if ( assignment.getRoleNames().isEmpty() )
+        {
+            throw new RbacObjectInvalidException( scope, "UserAssignment.roles cannot be empty." );
+        }
+          */
+        int i = 0;
+        for ( String name : assignment.getRoleNames() )
+        {
+            if ( StringUtils.isEmpty( name ) )
+            {
+                throw new RbacObjectInvalidException( scope, "UserAssignment.rolename[" + i + "] cannot be empty." );
+            }
+            i++;
+        }
+    }
+
+}
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/RbacManagerException.java b/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/RbacManagerException.java
new file mode 100644 (file)
index 0000000..6d1d0ad
--- /dev/null
@@ -0,0 +1,49 @@
+package org.apache.archiva.redback.rbac;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * RbacManagerException used by {@link RBACManager} methods to indicate
+ * a fundamental persistence or store issue. 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class RbacManagerException
+    extends Exception
+{
+    public RbacManagerException()
+    {
+        super();
+    }
+
+    public RbacManagerException( String message, Throwable cause )
+    {
+        super( message, cause );
+    }
+
+    public RbacManagerException( String message )
+    {
+        super( message );
+    }
+
+    public RbacManagerException( Throwable cause )
+    {
+        super( cause );
+    }
+
+}
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/RbacObjectInvalidException.java b/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/RbacObjectInvalidException.java
new file mode 100644 (file)
index 0000000..b816ea9
--- /dev/null
@@ -0,0 +1,53 @@
+package org.apache.archiva.redback.rbac;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * RbacObjectInvalidException 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class RbacObjectInvalidException
+    extends RbacManagerException
+{
+
+    public RbacObjectInvalidException()
+    {
+        super();
+    }
+
+    public RbacObjectInvalidException( String message, Throwable cause )
+    {
+        super( message, cause );
+    }
+
+    public RbacObjectInvalidException( String message )
+    {
+        super( message );
+    }
+    
+    public RbacObjectInvalidException( String scope, String message )
+    {
+        super( ( ( scope != null ) ? scope + ": " : "" ) + message );
+    }
+
+    public RbacObjectInvalidException( Throwable cause )
+    {
+        super( cause );
+    }
+}
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/RbacObjectNotFoundException.java b/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/RbacObjectNotFoundException.java
new file mode 100644 (file)
index 0000000..a5eca10
--- /dev/null
@@ -0,0 +1,70 @@
+package org.apache.archiva.redback.rbac;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * RbacObjectNotFoundException used by {@link RBACManager} methods to identify
+ * when a RBAC Object Was Not Found. 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class RbacObjectNotFoundException
+    extends RbacManagerException
+{
+    private Object object;
+
+    public RbacObjectNotFoundException()
+    {
+        super();
+    }
+
+    public RbacObjectNotFoundException( String message, Throwable cause )
+    {
+        super( message, cause );
+    }
+
+    public RbacObjectNotFoundException( String message, Throwable cause, Object object )
+    {
+        super( message, cause );
+        this.object = object;
+    }
+
+    public RbacObjectNotFoundException( String message )
+    {
+        super( message );
+    }
+
+    public RbacObjectNotFoundException( String message, Object object )
+    {
+        super( message );
+        this.object = object;
+    }
+
+    public RbacObjectNotFoundException( Throwable cause )
+    {
+        super( cause );
+    }
+
+    public Object getObject()
+    {
+        return object;
+    }
+}
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/RbacPermanentException.java b/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/RbacPermanentException.java
new file mode 100644 (file)
index 0000000..cf95ae2
--- /dev/null
@@ -0,0 +1,50 @@
+package org.apache.archiva.redback.rbac;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * RbacPermanentException - tossed when a forbidden action against a permanent RBAC Object occurs.  
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class RbacPermanentException
+    extends RbacManagerException
+{
+    public RbacPermanentException()
+    {
+        super();
+    }
+
+    public RbacPermanentException( String message, Throwable cause )
+    {
+        super( message, cause );
+    }
+
+    public RbacPermanentException( String message )
+    {
+        super( message );
+    }
+
+    public RbacPermanentException( Throwable cause )
+    {
+        super( cause );
+    }
+}
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/RbacSecurityViolation.java b/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/RbacSecurityViolation.java
new file mode 100644 (file)
index 0000000..43abf77
--- /dev/null
@@ -0,0 +1,28 @@
+package org.apache.archiva.redback.rbac;
+
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Exception thrown when there is a RBAC security violation.
+ */
+public class RbacSecurityViolation extends Exception
+{
+    public RbacSecurityViolation( String name )
+    {
+        super( name );
+    }
+}
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/Resource.java b/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/Resource.java
new file mode 100644 (file)
index 0000000..2eac18f
--- /dev/null
@@ -0,0 +1,99 @@
+package org.apache.archiva.redback.rbac;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Resource
+ *
+ * Resources are things that can be paired up with operations inside of a
+ * permission.
+ *
+ * Rbac doesn't strictly specify what a resource (or Object) is, so there are a
+ * couple of variations planned for resources.
+ *
+ * Initially the resource is simply a string representaton of whatever you desire
+ * to match up to an operation.  Eventually we want to support different types of
+ * expression evaluation for these resources, like a tuple resource.  *-* where
+ * wildcards can be used on the resource definition to streamline the assigning of
+ * permissions for _large_ sets of things.
+ *
+ * @author Jesse McConnell <jmcconnell@apache.org>
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public interface Resource
+{
+    /**
+     * Resource identifier refering to all objects.
+     */
+    public static final String GLOBAL = "*";
+
+    /**
+     * Resource identifier refering to no objects.
+     */
+    public static final String NULL = "-";
+
+    /**
+     * Get The string identifier for an operation.
+     *
+     * NOTE: This field is considered the Primary Key for this object.
+     */
+    public String getIdentifier();
+
+    /**
+     * true if the identifer is a pattern that is to be evaluated, for
+     * example x.* could match x.a or x.b and x.** could match x.foo
+     *
+     * Jesse: See {@link #setPattern(boolean)}
+     *
+     */
+    public boolean isPattern();
+
+    /**
+     * Set The string identifier for an operation.
+     *
+     * NOTE: This field is considered the Primary Key for this object.
+     * 
+     * @param identifier
+     */
+    public void setIdentifier( String identifier );
+
+    /**
+     * true if the identifer is a pattern that is to be evaluated, for
+     * example x.* could match x.a or x.b and x.** could match x.foo
+     *
+     * TODO is this even a good idea?
+     * TODO we could look for a character like '*' or a string starting with "%/" to indicate if this is a pattern or not.
+     * 
+     * @param pattern
+     */
+    public void setPattern( boolean pattern );
+
+    /**
+     * Test to see if the object is a permanent object or not.
+     * 
+     * @return true if the object is permanent.
+     */
+    public boolean isPermanent();
+
+    /**
+     * Set flag indicating if the object is a permanent object or not.
+     * 
+     * @param permanent true if the object is permanent.
+     */
+    public void setPermanent( boolean permanent );
+}
\ No newline at end of file
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/Role.java b/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/Role.java
new file mode 100644 (file)
index 0000000..a065ce2
--- /dev/null
@@ -0,0 +1,144 @@
+package org.apache.archiva.redback.rbac;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.List;
+
+/**
+ * Role
+ * <p/>
+ * A role is assignable to a user and effectively grants that user all of the
+ * permissions that are present in that role.  A role can also contain other roles
+ * which add the permissions in those roles to the available permissions for authorization.
+ * <p/>
+ * A role can contain any number of permissions
+ * A role can contain any number of other roles
+ * A role can be assigned to any number of users
+ *
+ * @author Jesse McConnell <jmcconnell@apache.org>
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public interface Role
+{
+
+    /**
+     * Method addPermission
+     *
+     * @param permission
+     */
+    void addPermission( Permission permission );
+
+    /**
+     * Method addChildRoleName
+     *
+     * @param name the name of the child role.
+     */
+    void addChildRoleName( String name );
+
+    /**
+     * Method getChildRoleNames
+     */
+    List<String> getChildRoleNames();
+
+    /**
+     * Convienence method to see if Role has Child Roles.
+     *
+     * @return true if child roles exists and has any roles being tracked.
+     */
+    boolean hasChildRoles();
+
+    /**
+     * Long description of the role.
+     */
+    String getDescription();
+
+    /**
+     * Get the name.
+     * <p/>
+     * NOTE: This field is considered the Primary Key for this object.
+     */
+    String getName();
+
+    /**
+     * Method getPermissions
+     */
+    List<Permission> getPermissions();
+
+    /**
+     * true if this role is available to be assigned to a user
+     */
+    boolean isAssignable();
+
+    /**
+     * Method removePermission
+     *
+     * @param permission
+     */
+    void removePermission( Permission permission );
+
+    /**
+     * true if this role is available to be assigned to a user
+     *
+     * @param assignable
+     */
+    void setAssignable( boolean assignable );
+
+    /**
+     * The names of the roles that will inherit the permissions of this role
+     *
+     * @param names the list of names of other roles.
+     */
+    void setChildRoleNames( List<String> names );
+
+    /**
+     * Set the Description
+     *
+     * @param description
+     */
+    void setDescription( String description );
+
+    /**
+     * Set Name
+     * <p/>
+     * NOTE: This field is considered the Primary Key for this object.
+     *
+     * @param name
+     */
+    void setName( String name );
+
+    /**
+     * Set Permissions
+     *
+     * @param permissions
+     */
+    void setPermissions( List<Permission> permissions );
+
+    /**
+     * Test to see if the object is a permanent object or not.
+     *
+     * @return true if the object is permanent.
+     */
+    boolean isPermanent();
+
+    /**
+     * Set flag indicating if the object is a permanent object or not.
+     *
+     * @param permanent true if the object is permanent.
+     */
+    void setPermanent( boolean permanent );
+}
\ No newline at end of file
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/TemplatedRole.java b/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/TemplatedRole.java
new file mode 100644 (file)
index 0000000..fa18d32
--- /dev/null
@@ -0,0 +1,89 @@
+package org.apache.archiva.redback.rbac;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+/**
+ * TemplatedRole
+ *
+ * @author <a href="hisidro@exist.com">Henry Isidro</a>
+ */
+public class TemplatedRole
+{
+    private Role role;
+    
+    private String templateNamePrefix;
+    
+    private String delimiter;
+    
+    public TemplatedRole(Role role, String templateNamePrefix, String delimeter)
+    {
+        this.role = role;
+        this.templateNamePrefix = templateNamePrefix;
+        this.delimiter = delimeter;
+    }
+    
+    public String getResource()
+    {
+        int index = role.getName().indexOf( getDelimiter() );
+        
+        return role.getName().substring( index + 3);
+    }
+
+    public Role getRole()
+    {
+        return role;
+    }
+
+    public void setRole( Role role )
+    {
+        this.role = role;
+    }
+
+    public String getTemplateNamePrefix()
+    {
+        return templateNamePrefix;
+    }
+
+    public void setTemplateNamePrefix( String templateNamePrefix )
+    {
+        this.templateNamePrefix = templateNamePrefix;
+    }
+
+    public String getDelimiter()
+    {
+        return delimiter;
+    }
+
+    public void setDelimiter( String delimiter )
+    {
+        this.delimiter = delimiter;
+    }
+
+    public String getName()
+    {
+        return this.role.getName();
+    }
+
+    public void setName( String name )
+    {
+        this.role.setName( name );
+    }
+}
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/UserAssignment.java b/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/UserAssignment.java
new file mode 100644 (file)
index 0000000..e2274a2
--- /dev/null
@@ -0,0 +1,109 @@
+package org.apache.archiva.redback.rbac;
+
+import java.util.List;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * UserAssignment - This the mapping object that takes the principal for a user and associates it with a
+ * set of Roles.
+ * 
+ * This is the many to many mapping object needed by persistence stores.
+ *
+ * @author Jesse McConnell <jmcconnell@apache.org>
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ * @todo expand on javadoc
+ */
+public interface UserAssignment
+{
+
+    
+    /**
+     * The principal for the User that the set of roles is associated with.
+     * 
+     * NOTE: This field is considered the Primary Key for this object.
+     * 
+     * @return the principal for the User.
+     */
+    String getPrincipal();
+
+    /**
+     * Get the roles for this user.
+     * 
+     * @return List of &lt;{@link String}&gt; objects representing the Role Names.
+     */
+    List<String> getRoleNames();
+    
+    /**
+     * Add a rolename to this assignment.
+     * 
+     * @param role the role.
+     */
+    void addRoleName( Role role );
+    
+    /**
+     * Add a rolename to this assignment.
+     * 
+     * @param roleName the role name.
+     */
+    void addRoleName( String roleName );
+    
+    /**
+     * Remove a rolename from this assignment.
+     * 
+     * @param role the role who's name is to be removed.
+     */
+    void removeRoleName( Role role );
+    
+    /**
+     * Remove a role name from this assignment.
+     * 
+     * @param roleName the role name to be removed.
+     */
+    void removeRoleName( String roleName );
+
+    /**
+     * Set the user principal object for this association.
+     * 
+     * NOTE: This field is considered the Primary Key for this object.
+     * 
+     * @param principal
+     */
+    void setPrincipal( String principal );
+
+    /**
+     * Set the roles names for this user.
+     * 
+     * @param roles the List of &lt;{@link String}&gt; objects representing the Role Names.
+     */
+    void setRoleNames( List<String> roles );
+    
+    /**
+     * Test to see if the object is a permanent object or not.
+     * 
+     * @return true if the object is permanent.
+     */
+    boolean isPermanent();
+
+    /**
+     * Set flag indicating if the object is a permanent object or not.
+     * 
+     * @param permanent true if the object is permanent.
+     */
+    void setPermanent( boolean permanent );
+}
\ No newline at end of file
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/AbstractRBACManager.java b/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/AbstractRBACManager.java
deleted file mode 100644 (file)
index 70b492b..0000000
+++ /dev/null
@@ -1,795 +0,0 @@
-package org.codehaus.plexus.redback.rbac;
-
-/*
- * Copyright 2001-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import org.codehaus.plexus.util.CollectionUtils;
-import org.codehaus.plexus.util.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.annotation.PostConstruct;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * AbstractRBACManager
- *
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- */
-public abstract class AbstractRBACManager
-    implements RBACManager
-{
-    protected Logger log = LoggerFactory.getLogger( getClass() );
-
-    private List<RBACManagerListener> listeners = new ArrayList<RBACManagerListener>( 0 );
-
-    private Resource globalResource;
-
-    @PostConstruct
-    public void initialize()
-    {
-        //no op
-    }
-
-    public void addListener( RBACManagerListener listener )
-    {
-        if ( !listeners.contains( listener ) )
-        {
-            listeners.add( listener );
-        }
-    }
-
-    public void removeListener( RBACManagerListener listener )
-    {
-        listeners.remove( listener );
-    }
-
-    public void fireRbacInit( boolean freshdb )
-    {
-        Iterator<RBACManagerListener> it = listeners.iterator();
-        while ( it.hasNext() )
-        {
-            RBACManagerListener listener = it.next();
-            try
-            {
-                listener.rbacInit( freshdb );
-            }
-            catch ( Exception e )
-            {
-                log.warn( "Unable to trigger .rbacInit( boolean ) to " + listener.getClass().getName(), e );
-            }
-        }
-    }
-
-    public void fireRbacRoleSaved( Role role )
-    {
-        Iterator<RBACManagerListener> it = listeners.iterator();
-        while ( it.hasNext() )
-        {
-            RBACManagerListener listener = it.next();
-            try
-            {
-                listener.rbacRoleSaved( role );
-            }
-            catch ( Exception e )
-            {
-                log.warn( "Unable to trigger .rbacRoleSaved( Role ) to " + listener.getClass().getName(), e );
-            }
-        }
-    }
-
-    public void fireRbacRoleRemoved( Role role )
-    {
-        Iterator<RBACManagerListener> it = listeners.iterator();
-        while ( it.hasNext() )
-        {
-            RBACManagerListener listener = it.next();
-            try
-            {
-                listener.rbacRoleRemoved( role );
-            }
-            catch ( Exception e )
-            {
-                log.warn( "Unable to trigger .rbacRoleRemoved( Role ) to " + listener.getClass().getName(), e );
-            }
-        }
-    }
-
-    public void fireRbacPermissionSaved( Permission permission )
-    {
-        Iterator<RBACManagerListener> it = listeners.iterator();
-        while ( it.hasNext() )
-        {
-            RBACManagerListener listener = it.next();
-            try
-            {
-                listener.rbacPermissionSaved( permission );
-            }
-            catch ( Exception e )
-            {
-                log.warn( "Unable to trigger .rbacPermissionSaved( Permission ) to " + listener.getClass().getName(),
-                          e );
-            }
-        }
-    }
-
-    public void fireRbacPermissionRemoved( Permission permission )
-    {
-        Iterator<RBACManagerListener> it = listeners.iterator();
-        while ( it.hasNext() )
-        {
-            RBACManagerListener listener = it.next();
-            try
-            {
-                listener.rbacPermissionRemoved( permission );
-            }
-            catch ( Exception e )
-            {
-                log.warn( "Unable to trigger .rbacPermissionRemoved( Permission ) to " + listener.getClass().getName(),
-                          e );
-            }
-        }
-    }
-
-    public void fireRbacUserAssignmentSaved( UserAssignment userAssignment )
-    {
-        Iterator<RBACManagerListener> it = listeners.iterator();
-        while ( it.hasNext() )
-        {
-            RBACManagerListener listener = it.next();
-            try
-            {
-                listener.rbacUserAssignmentSaved( userAssignment );
-            }
-            catch ( Exception e )
-            {
-                log.warn(
-                    "Unable to trigger .rbacUserAssignmentSaved( UserAssignment ) to " + listener.getClass().getName(),
-                    e );
-            }
-        }
-    }
-
-    public void fireRbacUserAssignmentRemoved( UserAssignment userAssignment )
-    {
-        Iterator<RBACManagerListener> it = listeners.iterator();
-        while ( it.hasNext() )
-        {
-            RBACManagerListener listener = it.next();
-            try
-            {
-                listener.rbacUserAssignmentRemoved( userAssignment );
-            }
-            catch ( Exception e )
-            {
-                log.warn( "Unable to trigger .rbacUserAssignmentRemoved( UserAssignment ) to "
-                              + listener.getClass().getName(), e );
-            }
-        }
-    }
-
-    public void removeRole( String roleName )
-        throws RbacObjectNotFoundException, RbacManagerException
-    {
-        removeRole( getRole( roleName ) );
-    }
-
-    public void removePermission( String permissionName )
-        throws RbacObjectNotFoundException, RbacManagerException
-    {
-        removePermission( getPermission( permissionName ) );
-    }
-
-    public void removeOperation( String operationName )
-        throws RbacObjectNotFoundException, RbacManagerException
-    {
-        removeOperation( getOperation( operationName ) );
-    }
-
-    public void removeResource( String resourceIdentifier )
-        throws RbacObjectNotFoundException, RbacManagerException
-    {
-        removeResource( getResource( resourceIdentifier ) );
-    }
-
-    public void removeUserAssignment( String principal )
-        throws RbacObjectNotFoundException, RbacManagerException
-    {
-        removeUserAssignment( getUserAssignment( principal ) );
-    }
-
-    public boolean resourceExists( Resource resource )
-    {
-        try
-        {
-            return getAllResources().contains( resource );
-        }
-        catch ( RbacManagerException e )
-        {
-            return false;
-        }
-    }
-
-    public boolean resourceExists( String identifier )
-    {
-        try
-        {
-            for ( Resource resource : getAllResources() )
-            {
-                if ( StringUtils.equals( resource.getIdentifier(), identifier ) )
-                {
-                    return true;
-                }
-            }
-        }
-        catch ( RbacManagerException e )
-        {
-            return false;
-        }
-
-        return false;
-    }
-
-    public boolean operationExists( Operation operation )
-    {
-        try
-        {
-            return getAllOperations().contains( operation );
-        }
-        catch ( RbacManagerException e )
-        {
-            return false;
-        }
-    }
-
-    public boolean operationExists( String name )
-    {
-        try
-        {
-            for ( Operation operation : getAllOperations() )
-            {
-                if ( StringUtils.equals( operation.getName(), name ) )
-                {
-                    return true;
-                }
-            }
-        }
-        catch ( RbacManagerException e )
-        {
-            return false;
-        }
-
-        return false;
-    }
-
-    public boolean permissionExists( Permission permission )
-    {
-        try
-        {
-            return getAllPermissions().contains( permission );
-        }
-        catch ( RbacManagerException e )
-        {
-            return false;
-        }
-    }
-
-    public boolean permissionExists( String name )
-    {
-        try
-        {
-            for ( Permission permission : getAllPermissions() )
-            {
-                if ( StringUtils.equals( permission.getName(), name ) )
-                {
-                    return true;
-                }
-            }
-        }
-        catch ( RbacManagerException e )
-        {
-            return false;
-        }
-
-        return false;
-    }
-
-    public boolean roleExists( Role role )
-    {
-        try
-        {
-            return getAllRoles().contains( role );
-        }
-        catch ( RbacManagerException e )
-        {
-            return false;
-        }
-    }
-
-    public boolean roleExists( String name )
-    {
-        try
-        {
-            for ( Role role : getAllRoles() )
-            {
-                if ( StringUtils.equals( role.getName(), name ) )
-                {
-                    return true;
-                }
-            }
-        }
-        catch ( RbacManagerException e )
-        {
-            return false;
-        }
-
-        return false;
-    }
-
-    public boolean userAssignmentExists( String principal )
-    {
-        try
-        {
-            for ( UserAssignment assignment : getAllUserAssignments() )
-            {
-                if ( StringUtils.equals( assignment.getPrincipal(), principal ) )
-                {
-                    return true;
-                }
-            }
-        }
-        catch ( RbacManagerException e )
-        {
-            return false;
-        }
-
-        return false;
-    }
-
-    public boolean userAssignmentExists( UserAssignment assignment )
-    {
-        try
-        {
-            return getAllUserAssignments().contains( assignment );
-        }
-        catch ( RbacManagerException e )
-        {
-            return false;
-        }
-    }
-
-    /**
-     * returns a set of all permissions that are in all active roles for a given
-     * principal
-     *
-     * @param principal
-     * @return
-     * @throws RbacObjectNotFoundException
-     * @throws RbacManagerException
-     */
-    public Set<Permission> getAssignedPermissions( String principal )
-        throws RbacObjectNotFoundException, RbacManagerException
-    {
-
-        UserAssignment ua = getUserAssignment( principal );
-
-        Set<Permission> permissionSet = new HashSet<Permission>();
-
-        if ( ua.getRoleNames() != null )
-        {
-            boolean childRoleNamesUpdated = false;
-
-            Iterator<String> it = ua.getRoleNames().listIterator();
-            while ( it.hasNext() )
-            {
-                String roleName = it.next();
-                try
-                {
-                    Role role = getRole( roleName );
-                    gatherUniquePermissions( role, permissionSet );
-                }
-                catch ( RbacObjectNotFoundException e )
-                {
-                    // Found a bad role name. remove it!
-                    it.remove();
-                    childRoleNamesUpdated = true;
-                }
-            }
-
-            if ( childRoleNamesUpdated )
-            {
-                saveUserAssignment( ua );
-            }
-        }
-
-        return permissionSet;
-    }
-
-    /**
-     * returns a map of assigned permissions keyed off of operations
-     *
-     * @param principal
-     * @return
-     * @throws RbacObjectNotFoundException
-     * @throws RbacManagerException
-     */
-    public Map<String, List<Permission>> getAssignedPermissionMap( String principal )
-        throws RbacObjectNotFoundException, RbacManagerException
-    {
-        return getPermissionMapByOperation( getAssignedPermissions( principal ) );
-    }
-
-    private Map<String, List<Permission>> getPermissionMapByOperation( Collection<Permission> permissions )
-    {
-        Map<String, List<Permission>> userPermMap = new HashMap<String, List<Permission>>();
-
-        for ( Permission permission : permissions )
-        {
-            List<Permission> permList = userPermMap.get( permission.getOperation().getName() );
-
-            if ( permList != null )
-            {
-                permList.add( permission );
-            }
-            else
-            {
-                List<Permission> newPermList = new ArrayList<Permission>( permissions.size() );
-                newPermList.add( permission );
-                userPermMap.put( permission.getOperation().getName(), newPermList );
-            }
-        }
-
-        return userPermMap;
-    }
-
-    private void gatherUniquePermissions( Role role, Collection<Permission> coll )
-        throws RbacManagerException
-    {
-        if ( role.getPermissions() != null )
-        {
-            for ( Permission permission : role.getPermissions() )
-            {
-                if ( !coll.contains( permission ) )
-                {
-                    coll.add( permission );
-                }
-            }
-        }
-
-        if ( role.hasChildRoles() )
-        {
-            Map<String, Role> childRoles = getChildRoles( role );
-            Iterator<Role> it = childRoles.values().iterator();
-            while ( it.hasNext() )
-            {
-                Role child = it.next();
-                gatherUniquePermissions( child, coll );
-            }
-        }
-    }
-
-    public List<Role> getAllAssignableRoles()
-        throws RbacManagerException, RbacObjectNotFoundException
-    {
-        List<Role> assignableRoles = new ArrayList<Role>();
-
-        for ( Role r : getAllRoles() )
-        {
-            Role role = getRole( r.getName() );
-            if ( role.isAssignable() )
-            {
-                assignableRoles.add( role );
-            }
-        }
-
-        return assignableRoles;
-    }
-
-    /**
-     * returns the active roles for a given principal
-     * <p/>
-     * NOTE: roles that are returned might have have roles themselves, if
-     * you just want all permissions then use {@link #getAssignedPermissions(String principal)}
-     *
-     * @param principal
-     * @return
-     * @throws RbacObjectNotFoundException
-     * @throws RbacManagerException
-     */
-    public Collection<Role> getAssignedRoles( String principal )
-        throws RbacObjectNotFoundException, RbacManagerException
-    {
-        UserAssignment ua = getUserAssignment( principal );
-
-        return getAssignedRoles( ua );
-    }
-
-    /**
-     * returns only the roles that are assigned, not the roles that might be child roles of the
-     * assigned roles.
-     *
-     * @param ua
-     * @return
-     * @throws RbacObjectNotFoundException
-     * @throws RbacManagerException
-     */
-    public Collection<Role> getAssignedRoles( UserAssignment ua )
-        throws RbacObjectNotFoundException, RbacManagerException
-    {
-        Set<Role> roleSet = new HashSet<Role>();
-
-        if ( ua.getRoleNames() != null )
-        {
-            boolean childRoleNamesUpdated = false;
-
-            Iterator<String> it = ua.getRoleNames().listIterator();
-            while ( it.hasNext() )
-            {
-                String roleName = it.next();
-                try
-                {
-                    Role role = getRole( roleName );
-
-                    if ( !roleSet.contains( role ) )
-                    {
-                        roleSet.add( role );
-                    }
-                }
-                catch ( RbacObjectNotFoundException e )
-                {
-                    // Found a bad role name. remove it!
-                    it.remove();
-                    childRoleNamesUpdated = true;
-                }
-            }
-
-            if ( childRoleNamesUpdated )
-            {
-                saveUserAssignment( ua );
-            }
-        }
-
-        return roleSet;
-    }
-
-    /**
-     * get all of the roles that the give role has as a child into a set
-     *
-     * @param role
-     * @param roleSet
-     * @throws RbacObjectNotFoundException
-     * @throws RbacManagerException
-     */
-    private void gatherEffectiveRoles( Role role, Set<Role> roleSet )
-        throws RbacObjectNotFoundException, RbacManagerException
-    {
-        if ( role.hasChildRoles() )
-        {
-            for ( String roleName : role.getChildRoleNames() )
-            {
-                try
-                {
-                    Role crole = getRole( roleName );
-
-                    if ( !roleSet.contains( crole ) )
-                    {
-                        gatherEffectiveRoles( crole, roleSet );
-                    }
-                }
-                catch ( RbacObjectNotFoundException e )
-                {
-                    // the client application might not manage role clean up totally correctly so we want to notify
-                    // of a child role issue and offer a clean up process at some point
-                    log.warn( "dangling child role: " + roleName + " on " + role.getName() );
-                }
-            }
-        }
-
-        if ( !roleSet.contains( role ) )
-        {
-            roleSet.add( role );
-        }
-    }
-
-    public Collection<Role> getEffectivelyAssignedRoles( String principal )
-        throws RbacObjectNotFoundException, RbacManagerException
-    {
-        UserAssignment ua = getUserAssignment( principal );
-
-        return getEffectivelyAssignedRoles( ua );
-    }
-
-    public Collection<Role> getEffectivelyAssignedRoles( UserAssignment ua )
-        throws RbacObjectNotFoundException, RbacManagerException
-    {
-        Set<Role> roleSet = new HashSet<Role>();
-
-        if ( ua != null && ua.getRoleNames() != null )
-        {
-            boolean childRoleNamesUpdated = false;
-
-            Iterator<String> it = ua.getRoleNames().listIterator();
-            while ( it.hasNext() )
-            {
-                String roleName = it.next();
-                try
-                {
-                    Role role = getRole( roleName );
-
-                    gatherEffectiveRoles( role, roleSet );
-                }
-                catch ( RbacObjectNotFoundException e )
-                {
-                    // Found a bad role name. remove it!
-                    it.remove();
-                    childRoleNamesUpdated = true;
-                }
-            }
-
-            if ( childRoleNamesUpdated )
-            {
-                saveUserAssignment( ua );
-            }
-        }
-        return roleSet;
-    }
-
-    /**
-     * @param principal
-     * @return
-     * @throws RbacManagerException
-     * @throws RbacObjectNotFoundException
-     */
-    @SuppressWarnings( "unchecked" )
-    public Collection<Role> getEffectivelyUnassignedRoles( String principal )
-        throws RbacManagerException, RbacObjectNotFoundException
-    {
-        Collection<Role> assignedRoles = getEffectivelyAssignedRoles( principal );
-        List<Role> allRoles = getAllAssignableRoles();
-
-        log.debug( "UR: assigned {}", assignedRoles.size() );
-        log.debug( "UR: available {}", allRoles.size() );
-
-        return CollectionUtils.subtract( allRoles, assignedRoles );
-    }
-
-
-    /**
-     * @param principal
-     * @return
-     * @throws RbacManagerException
-     * @throws RbacObjectNotFoundException
-     */
-    @SuppressWarnings( "unchecked" )
-    public Collection<Role> getUnassignedRoles( String principal )
-        throws RbacManagerException, RbacObjectNotFoundException
-    {
-        Collection<Role> assignedRoles = getAssignedRoles( principal );
-        List<Role> allRoles = getAllAssignableRoles();
-
-        log.debug( "UR: assigned {}", assignedRoles.size() );
-        log.debug( "UR: available {}", allRoles.size() );
-
-        return CollectionUtils.subtract( allRoles, assignedRoles );
-    }
-
-    public Resource getGlobalResource()
-        throws RbacManagerException
-    {
-        if ( globalResource == null )
-        {
-            globalResource = createResource( Resource.GLOBAL );
-            globalResource.setPermanent( true );
-            globalResource = saveResource( globalResource );
-        }
-        return globalResource;
-    }
-
-    public void addChildRole( Role role, Role childRole )
-        throws RbacObjectInvalidException, RbacManagerException
-    {
-        saveRole( childRole );
-        role.addChildRoleName( childRole.getName() );
-    }
-
-    public Map<String, Role> getChildRoles( Role role )
-        throws RbacManagerException
-    {
-        Map<String, Role> childRoles = new HashMap<String, Role>();
-
-        boolean childRoleNamesUpdated = false;
-
-        Iterator<String> it = role.getChildRoleNames().listIterator();
-        while ( it.hasNext() )
-        {
-            String roleName = (String) it.next();
-            try
-            {
-                Role child = getRole( roleName );
-                childRoles.put( child.getName(), child );
-            }
-            catch ( RbacObjectNotFoundException e )
-            {
-                // Found a bad roleName! - remove it.
-                it.remove();
-                childRoleNamesUpdated = true;
-            }
-        }
-
-        if ( childRoleNamesUpdated )
-        {
-            saveRole( role );
-        }
-
-        return childRoles;
-    }
-
-    public Map<String, Role> getParentRoles( Role role )
-        throws RbacManagerException
-    {
-        Map<String, Role> parentRoles = new HashMap<String, Role>();
-
-        for ( Role r : getAllRoles() )
-        {
-            if ( !r.getName().equals( role.getName() ) )
-            {
-                Set<Role> effectiveRoles = getEffectiveRoles( r );
-                for ( Role currentRole : effectiveRoles )
-                {
-                    if ( currentRole.getName().equals( role.getName() ) )
-                    {
-                        if ( !parentRoles.containsKey( r.getName() ) )
-                        {
-                            parentRoles.put( r.getName(), r );
-                        }
-                    }
-                }
-            }
-        }
-        return parentRoles;
-    }
-
-    public Set<Role> getEffectiveRoles( Role role )
-        throws RbacObjectNotFoundException, RbacManagerException
-    {
-        Set<Role> roleSet = new HashSet<Role>();
-        gatherEffectiveRoles( role, roleSet );
-
-        return roleSet;
-    }
-
-    public Map<String, Role> getRoles( Collection<String> roleNames )
-        throws RbacObjectNotFoundException, RbacManagerException
-    {
-        Map<String, Role> roleMap = new HashMap<String, Role>();
-
-        for ( String roleName : roleNames )
-        {
-            Role child = getRole( roleName );
-            roleMap.put( child.getName(), child );
-        }
-
-        return roleMap;
-    }
-}
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/AbstractRole.java b/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/AbstractRole.java
deleted file mode 100644 (file)
index bdf1051..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-package org.codehaus.plexus.redback.rbac;
-
-/*
- * Copyright 2001-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * AbstractRole useful for common logic that implementors can use. 
- *
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- */
-public abstract class AbstractRole
-    implements Role
-{
-
-    public boolean hasChildRoles()
-    {
-        return ( getChildRoleNames() != null ) && !getChildRoleNames().isEmpty();
-    }
-}
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/AbstractUserAssignment.java b/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/AbstractUserAssignment.java
deleted file mode 100644 (file)
index 7c8aa86..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.codehaus.plexus.redback.rbac;
-
-import java.util.List;
-
-/*
- * Copyright 2001-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * AbstractUserAssignment useful for common logic that implementors can use. 
- *
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- */
-public abstract class AbstractUserAssignment
-    implements UserAssignment
-{
-
-    public void addRoleName( Role role )
-    {
-        addRoleName( role.getName() );
-    }
-
-    public void addRoleName( String roleName )
-    {
-        List<String> names = getRoleNames();
-        if ( !names.contains( roleName ) )
-        {
-            names.add( roleName );
-        }
-        setRoleNames( names );
-    }
-
-    public void removeRoleName( Role role )
-    {
-        removeRoleName( role.getName() );
-    }
-
-    public void removeRoleName( String roleName )
-    {
-        getRoleNames().remove( roleName );
-    }
-}
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/Operation.java b/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/Operation.java
deleted file mode 100644 (file)
index 2a043bb..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-package org.codehaus.plexus.redback.rbac;
-
-/*
- * Copyright 2001-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * Operation
- * <p/>
- * In RBAC the operation is an action or functionality that can be linked with a
- * particular resource into an assignable Permission.  Operations don't exist outside
- * Permissions.
- *
- * @author Jesse McConnell <jmcconnell@apache.org>
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- */
-public interface Operation
-{
-
-
-    /**
-     * Long description of an operation.
-     *
-     * @return String
-     */
-    String getDescription();
-
-    /**
-     * name of the operation that is used in the act of authorization
-     * <p/>
-     * 'modify-foo', 'change-password'
-     * <p/>
-     * NOTE: This field is considered the Primary Key for this object.
-     *
-     * @return the name of the operation.
-     */
-    String getName();
-
-    /**
-     * @param description
-     */
-    void setDescription( String description );
-
-    /**
-     * Set name of the operation that is used in the act of authorization
-     * <p/>
-     * 'modify-foo', 'change-password'
-     * <p/>
-     * NOTE: This field is considered the Primary Key for this object.
-     *
-     * @param name
-     */
-    void setName( String name );
-
-    /**
-     * Test to see if the object is a permanent object or not.
-     *
-     * @return true if the object is permanent.
-     */
-    boolean isPermanent();
-
-    /**
-     * Set flag indicating if the object is a permanent object or not.
-     *
-     * @param permanent true if the object is permanent.
-     */
-    void setPermanent( boolean permanent );
-}
\ No newline at end of file
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/Permission.java b/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/Permission.java
deleted file mode 100644 (file)
index 2625c0b..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-package org.codehaus.plexus.redback.rbac;
-
-/*
- * Copyright 2001-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * Permission
- * <p/>
- * A permission is the wrapper for an operation and a resource effectively saying
- * that the operation is authorized for that resource.
- * <p/>
- * P(Operation, Resource)
- *
- * @author Jesse McConnell <jmcconnell@apache.org>
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- */
-public interface Permission
-{
-
-    /**
-     * Long description of the Permission
-     */
-    String getDescription();
-
-    /**
-     * Get the short name of the permission.
-     * <p/>
-     * NOTE: This field is considered the Primary Key for this object.
-     *
-     * @return the short name for this permission.
-     */
-    String getName();
-
-    /**
-     * Operation that this permission is authorizing
-     */
-    Operation getOperation();
-
-    /**
-     * This is the resource associated with this permission.
-     * <p/>
-     * Implementors must always supply a Resource.
-     *
-     * @return the Resource.
-     */
-    Resource getResource();
-
-    /**
-     * Set null
-     *
-     * @param description
-     */
-    void setDescription( String description );
-
-    /**
-     * Set the short name for this permission.
-     *
-     * @param name
-     */
-    void setName( String name );
-
-    /**
-     * Set null
-     *
-     * @param operation
-     */
-    void setOperation( Operation operation );
-
-    /**
-     * @param resource
-     */
-    void setResource( Resource resource );
-
-    /**
-     * Test to see if the object is a permanent object or not.
-     *
-     * @return true if the object is permanent.
-     */
-    boolean isPermanent();
-
-    /**
-     * Set flag indicating if the object is a permanent object or not.
-     *
-     * @param permanent true if the object is permanent.
-     */
-    void setPermanent( boolean permanent );
-}
\ No newline at end of file
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/RBACManager.java b/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/RBACManager.java
deleted file mode 100644 (file)
index dffbaa4..0000000
+++ /dev/null
@@ -1,424 +0,0 @@
-package org.codehaus.plexus.redback.rbac;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * RBACManager
- *
- * @author Jesse McConnell <jmcconnell@apache.org>
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- * @todo expand on javadoc
- */
-public interface RBACManager
-{
-
-    void addListener( RBACManagerListener listener );
-
-    void removeListener( RBACManagerListener listener );
-
-    // ------------------------------------------------------------------
-    // Role Methods
-    // ------------------------------------------------------------------
-
-    /**
-     * Creates an implementation specific {@link Role}, or return an existing {@link Role}, depending
-     * on the provided <code>name</code> parameter.
-     * <p/>
-     * Note: Be sure to use {@link #saveRole(Role)} in order to persist any changes to the Role.
-     *
-     * @param name the name.
-     * @return the new {@link Role} object.
-     */
-    Role createRole( String name );
-
-    /**
-     * Tests for the existence of a Role.
-     *
-     * @return true if role exists in store.
-     * @throws RbacManagerException
-     */
-    boolean roleExists( String name );
-
-    boolean roleExists( Role role );
-
-    Role saveRole( Role role )
-        throws RbacObjectInvalidException, RbacManagerException;
-
-    void saveRoles( Collection<Role> roles )
-        throws RbacObjectInvalidException, RbacManagerException;
-
-    /**
-     * @param roleName
-     * @return
-     * @throws RbacObjectNotFoundException
-     * @throws RbacManagerException
-     */
-    Role getRole( String roleName )
-        throws RbacObjectNotFoundException, RbacManagerException;
-
-    Map<String, Role> getRoles( Collection<String> roleNames )
-        throws RbacObjectNotFoundException, RbacManagerException;
-
-    void addChildRole( Role role, Role childRole )
-        throws RbacObjectInvalidException, RbacManagerException;
-
-    Map<String, Role> getChildRoles( Role role )
-        throws RbacManagerException;
-
-    Map<String, Role> getParentRoles( Role role )
-        throws RbacManagerException;
-
-    /**
-     * Method getRoles
-     */
-    List<Role> getAllRoles()
-        throws RbacManagerException;
-
-    /**
-     * Method getEffectiveRoles
-     */
-    Set<Role> getEffectiveRoles( Role role )
-        throws RbacObjectNotFoundException, RbacManagerException;
-
-    /**
-     * Method removeRole
-     *
-     * @param role
-     */
-    void removeRole( Role role )
-        throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException;
-
-    /**
-     * Method removeRole
-     *
-     * @param roleName
-     */
-    void removeRole( String roleName )
-        throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException;
-
-    // ------------------------------------------------------------------
-    // Permission Methods
-    // ------------------------------------------------------------------
-
-    /**
-     * Creates an implementation specific {@link Permission}, or return an existing {@link Permission}, depending
-     * on the provided <code>name</code> parameter.
-     * <p/>
-     * Note: Be sure to use {@link #savePermission(Permission)} in order to persist any changes to the Role.
-     *
-     * @param name the name.
-     * @return the new Permission.
-     * @throws RbacManagerException
-     */
-    Permission createPermission( String name )
-        throws RbacManagerException;
-
-    /**
-     * Creates an implementation specific {@link Permission} with specified {@link Operation},
-     * and {@link Resource} identifiers.
-     * <p/>
-     * Note: Be sure to use {@link #savePermission(Permission)} in order to persist any changes to the Role.
-     *
-     * @param name               the name.
-     * @param operationName      the {@link Operation#setName(String)} value
-     * @param resourceIdentifier the {@link Resource#setIdentifier(String)} value
-     * @return the new Permission.
-     * @throws RbacManagerException
-     */
-    Permission createPermission( String name, String operationName, String resourceIdentifier )
-        throws RbacManagerException;
-
-    /**
-     * Tests for the existence of a permission.
-     *
-     * @param name the name to test for.
-     * @return true if permission exists.
-     * @throws RbacManagerException
-     */
-    boolean permissionExists( String name );
-
-    boolean permissionExists( Permission permission );
-
-    Permission savePermission( Permission permission )
-        throws RbacObjectInvalidException, RbacManagerException;
-
-    Permission getPermission( String permissionName )
-        throws RbacObjectNotFoundException, RbacManagerException;
-
-    List<Permission> getAllPermissions()
-        throws RbacManagerException;
-
-    void removePermission( Permission permission )
-        throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException;
-
-    void removePermission( String permissionName )
-        throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException;
-
-    // ------------------------------------------------------------------
-    // Operation Methods
-    // ------------------------------------------------------------------
-
-    /**
-     * Creates an implementation specific {@link Operation}, or return an existing {@link Operation}, depending
-     * on the provided <code>name</code> parameter.
-     * <p/>
-     * Note: Be sure to use {@link #saveOperation(Operation)} in order to persist any changes to the Role.
-     *
-     * @param name the name.
-     * @return the new Operation.
-     * @throws RbacManagerException
-     */
-    Operation createOperation( String name )
-        throws RbacManagerException;
-
-    boolean operationExists( String name );
-
-    boolean operationExists( Operation operation );
-
-    /**
-     * Save the new or existing operation to the store.
-     *
-     * @param operation the operation to save (new or existing)
-     * @return the Operation that was saved.
-     * @throws RbacObjectInvalidException
-     * @throws RbacManagerException
-     */
-    Operation saveOperation( Operation operation )
-        throws RbacObjectInvalidException, RbacManagerException;
-
-    Operation getOperation( String operationName )
-        throws RbacObjectNotFoundException, RbacManagerException;
-
-    List<Operation> getAllOperations()
-        throws RbacManagerException;
-
-    void removeOperation( Operation operation )
-        throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException;
-
-    void removeOperation( String operationName )
-        throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException;
-
-    // ------------------------------------------------------------------
-    // Resource Methods
-    // ------------------------------------------------------------------
-
-    /**
-     * Creates an implementation specific {@link Resource}, or return an existing {@link Resource}, depending
-     * on the provided <code>identifier</code> parameter.
-     * <p/>
-     * Note: Be sure to use {@link #saveResource(Resource)} in order to persist any changes to the Role.
-     *
-     * @param identifier the identifier.
-     * @return the new Resource.
-     * @throws RbacManagerException
-     */
-    Resource createResource( String identifier )
-        throws RbacManagerException;
-
-    boolean resourceExists( String identifier );
-
-    boolean resourceExists( Resource resource );
-
-    Resource saveResource( Resource resource )
-        throws RbacObjectInvalidException, RbacManagerException;
-
-    Resource getResource( String resourceIdentifier )
-        throws RbacObjectNotFoundException, RbacManagerException;
-
-    List<Resource> getAllResources()
-        throws RbacManagerException;
-
-    void removeResource( Resource resource )
-        throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException;
-
-    void removeResource( String resourceIdentifier )
-        throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException;
-
-    // ------------------------------------------------------------------
-    // UserAssignment Methods
-    // ------------------------------------------------------------------
-
-    /**
-     * Creates an implementation specific {@link UserAssignment}, or return an existing {@link UserAssignment},
-     * depending on the provided <code>identifier</code> parameter.
-     * <p/>
-     * Note: Be sure to use {@link #saveUserAssignment(UserAssignment)} in order to persist any changes to the Role.
-     *
-     * @param principal the principal reference to the user.
-     * @return the new UserAssignment object.
-     * @throws RbacManagerException
-     */
-    UserAssignment createUserAssignment( String principal )
-        throws RbacManagerException;
-
-    boolean userAssignmentExists( String principal );
-
-    boolean userAssignmentExists( UserAssignment assignment );
-
-    /**
-     * Method saveUserAssignment
-     *
-     * @param userAssignment
-     */
-    UserAssignment saveUserAssignment( UserAssignment userAssignment )
-        throws RbacObjectInvalidException, RbacManagerException;
-
-    UserAssignment getUserAssignment( String principal )
-        throws RbacObjectNotFoundException, RbacManagerException;
-
-    /**
-     * Method getAssignments
-     */
-    List<UserAssignment> getAllUserAssignments()
-        throws RbacManagerException;
-
-    /**
-     * Method getUserAssignmentsForRoless
-     */
-    List<UserAssignment> getUserAssignmentsForRoles( Collection<String> roleNames )
-        throws RbacManagerException;
-
-    /**
-     * Method removeAssignment
-     *
-     * @param userAssignment
-     */
-    void removeUserAssignment( UserAssignment userAssignment )
-        throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException;
-
-    /**
-     * Method removeAssignment
-     *
-     * @param principal
-     */
-    void removeUserAssignment( String principal )
-        throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException;
-
-    // ------------------------------------------------------------------
-    // UserAssignment Utility Methods
-    // ------------------------------------------------------------------
-
-    /**
-     * returns the active roles for a given principal
-     * <p/>
-     * NOTE: roles that are returned might have have roles themselves, if
-     * you just want all permissions then use {@link #getAssignedPermissions(String principal)}
-     *
-     * @param principal
-     * @return Collection of {@link Role} objects.
-     * @throws RbacObjectNotFoundException
-     * @throws RbacManagerException
-     */
-    Collection<Role> getAssignedRoles( String principal )
-        throws RbacObjectNotFoundException, RbacManagerException;
-
-    /**
-     * Get the Collection of {@link Role} objects for this UserAssignment.
-     *
-     * @param userAssignment
-     * @return Collection of {@link Role} objects for the provided UserAssignment.
-     */
-    Collection<Role> getAssignedRoles( UserAssignment userAssignment )
-        throws RbacObjectNotFoundException, RbacManagerException;
-
-    /**
-     * Get a list of all assignable roles that are currently not effectively assigned to the specific user,
-     * meaning, not a child of any already granted role
-     *
-     * @param principal
-     * @return
-     * @throws RbacManagerException
-     * @throws RbacObjectNotFoundException
-     */
-    Collection<Role> getEffectivelyUnassignedRoles( String principal )
-        throws RbacManagerException, RbacObjectNotFoundException;
-
-    /**
-     * Get a list of the effectively assigned roles to the specified user, this includes child roles
-     *
-     * @param principal
-     * @return
-     * @throws RbacObjectNotFoundException
-     * @throws RbacManagerException
-     */
-    Collection<Role> getEffectivelyAssignedRoles( String principal )
-        throws RbacObjectNotFoundException, RbacManagerException;
-
-    /**
-     * Get a list of all assignable roles that are currently not assigned to the specific user.
-     *
-     * @param principal
-     * @return
-     * @throws RbacManagerException
-     * @throws RbacObjectNotFoundException
-     */
-    Collection<Role> getUnassignedRoles( String principal )
-        throws RbacManagerException, RbacObjectNotFoundException;
-
-    /**
-     * returns a set of all permissions that are in all active roles for a given
-     * principal
-     *
-     * @param principal
-     * @return
-     * @throws RbacObjectNotFoundException
-     * @throws RbacManagerException
-     */
-    Set<Permission> getAssignedPermissions( String principal )
-        throws RbacObjectNotFoundException, RbacManagerException;
-
-    /**
-     * returns a map of assigned permissions keyed off of operation with a list value of Permissions
-     *
-     * @param principal
-     * @return
-     * @throws RbacObjectNotFoundException
-     * @throws RbacManagerException
-     */
-    Map<String, List<Permission>> getAssignedPermissionMap( String principal )
-        throws RbacObjectNotFoundException, RbacManagerException;
-
-    /**
-     * returns a list of all assignable roles
-     *
-     * @return
-     * @throws RbacManagerException
-     * @throws RbacObjectNotFoundException
-     */
-    List<Role> getAllAssignableRoles()
-        throws RbacManagerException, RbacObjectNotFoundException;
-
-    /**
-     * returns the global resource object
-     *
-     * @return
-     * @throws RbacManagerException
-     */
-    Resource getGlobalResource()
-        throws RbacManagerException;
-
-    void eraseDatabase();
-}
\ No newline at end of file
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/RBACManagerListener.java b/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/RBACManagerListener.java
deleted file mode 100644 (file)
index 1f1eab4..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.codehaus.plexus.redback.rbac;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * RBACManagerListener 
- *
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- */
-public interface RBACManagerListener
-{
-    public void rbacInit( boolean freshdb );
-
-    public void rbacRoleSaved( Role role );
-
-    public void rbacRoleRemoved( Role role );
-
-    public void rbacPermissionSaved( Permission permission );
-
-    public void rbacPermissionRemoved( Permission permission );
-
-    public void rbacUserAssignmentSaved( UserAssignment userAssignment );
-
-    public void rbacUserAssignmentRemoved( UserAssignment userAssignment );
-}
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/RBACObjectAssertions.java b/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/RBACObjectAssertions.java
deleted file mode 100644 (file)
index 9fa415c..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-package org.codehaus.plexus.redback.rbac;
-
-/*
- * Copyright 2001-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import org.codehaus.plexus.util.StringUtils;
-
-/**
- * RBACObjectAssertions 
- *
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- */
-public class RBACObjectAssertions
-{
-    public static void assertValid( Role role )
-        throws RbacObjectInvalidException
-    {
-        assertValid( null, role );
-    }
-
-    public static void assertValid( String scope, Role role )
-        throws RbacObjectInvalidException
-    {
-        if ( role == null )
-        {
-            throw new RbacObjectInvalidException( scope, "Null Role object is invalid." );
-        }
-
-        if ( StringUtils.isEmpty( role.getName() ) )
-        {
-            throw new RbacObjectInvalidException( scope, "Role.name must not be empty." );
-        }
-
-        if ( role.getPermissions() != null )
-        {
-            int i = 0;
-            for ( Permission perm : role.getPermissions() )
-            {
-                assertValid( "Role.permissions[" + i + "]", perm );
-                i++;
-            }
-        }
-    }
-
-    public static void assertValid( Permission permission )
-        throws RbacObjectInvalidException
-    {
-        assertValid( null, permission );
-    }
-
-    public static void assertValid( String scope, Permission permission )
-        throws RbacObjectInvalidException
-    {
-        if ( permission == null )
-        {
-            throw new RbacObjectInvalidException( scope, "Null Permission object is invalid." );
-        }
-
-        if ( StringUtils.isEmpty( permission.getName() ) )
-        {
-            throw new RbacObjectInvalidException( scope, "Permission.name must not be empty." );
-        }
-
-        assertValid( "Permission.operation", permission.getOperation() );
-        assertValid( "Permission.resource", permission.getResource() );
-
-    }
-
-    public static void assertValid( Operation operation )
-        throws RbacObjectInvalidException
-    {
-        assertValid( null, operation );
-    }
-
-    public static void assertValid( String scope, Operation operation )
-        throws RbacObjectInvalidException
-    {
-        if ( operation == null )
-        {
-            throw new RbacObjectInvalidException( scope, "Null Operation object is invalid." );
-        }
-
-        if ( StringUtils.isEmpty( operation.getName() ) )
-        {
-            throw new RbacObjectInvalidException( scope, "Operation.name must not be empty." );
-        }
-    }
-
-    public static void assertValid( Resource resource )
-        throws RbacObjectInvalidException
-    {
-        assertValid( null, resource );
-    }
-
-    public static void assertValid( String scope, Resource resource )
-        throws RbacObjectInvalidException
-    {
-        if ( resource == null )
-        {
-            throw new RbacObjectInvalidException( scope, "Null Resource object is invalid." );
-        }
-
-        if ( StringUtils.isEmpty( resource.getIdentifier() ) )
-        {
-            throw new RbacObjectInvalidException( scope, "Resource.identifier must not be empty." );
-        }
-    }
-
-    public static void assertValid( UserAssignment assignment )
-        throws RbacObjectInvalidException
-    {
-        assertValid( null, assignment );
-    }
-
-    public static void assertValid( String scope, UserAssignment assignment )
-        throws RbacObjectInvalidException
-    {
-        if ( assignment == null )
-        {
-            throw new RbacObjectInvalidException( scope, "Null UserAssigment object is invalid." );
-        }
-
-        if ( StringUtils.isEmpty( assignment.getPrincipal() ) )
-        {
-            throw new RbacObjectInvalidException( scope, "UserAssigment.principal cannot be empty." );
-        }
-
-        if ( assignment.getRoleNames() == null )
-        {
-            throw new RbacObjectInvalidException( scope, "UserAssignment.roles cannot be null." );
-        }
-
-        /*  I don't believe this assertion is valid, a person should be able to be stripped of all roles.
-           -- jesse
-        if ( assignment.getRoleNames().isEmpty() )
-        {
-            throw new RbacObjectInvalidException( scope, "UserAssignment.roles cannot be empty." );
-        }
-          */
-        int i = 0;
-        for ( String name : assignment.getRoleNames() )
-        {
-            if ( StringUtils.isEmpty( name ) )
-            {
-                throw new RbacObjectInvalidException( scope, "UserAssignment.rolename[" + i + "] cannot be empty." );
-            }
-            i++;
-        }
-    }
-
-}
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/RbacManagerException.java b/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/RbacManagerException.java
deleted file mode 100644 (file)
index c05492e..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-package org.codehaus.plexus.redback.rbac;
-
-/*
- * Copyright 2001-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * RbacManagerException used by {@link RBACManager} methods to indicate
- * a fundamental persistence or store issue. 
- *
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- */
-public class RbacManagerException
-    extends Exception
-{
-    public RbacManagerException()
-    {
-        super();
-    }
-
-    public RbacManagerException( String message, Throwable cause )
-    {
-        super( message, cause );
-    }
-
-    public RbacManagerException( String message )
-    {
-        super( message );
-    }
-
-    public RbacManagerException( Throwable cause )
-    {
-        super( cause );
-    }
-
-}
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/RbacObjectInvalidException.java b/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/RbacObjectInvalidException.java
deleted file mode 100644 (file)
index 1e59053..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-package org.codehaus.plexus.redback.rbac;
-
-/*
- * Copyright 2001-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * RbacObjectInvalidException 
- *
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- */
-public class RbacObjectInvalidException
-    extends RbacManagerException
-{
-
-    public RbacObjectInvalidException()
-    {
-        super();
-    }
-
-    public RbacObjectInvalidException( String message, Throwable cause )
-    {
-        super( message, cause );
-    }
-
-    public RbacObjectInvalidException( String message )
-    {
-        super( message );
-    }
-    
-    public RbacObjectInvalidException( String scope, String message )
-    {
-        super( ( ( scope != null ) ? scope + ": " : "" ) + message );
-    }
-
-    public RbacObjectInvalidException( Throwable cause )
-    {
-        super( cause );
-    }
-}
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/RbacObjectNotFoundException.java b/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/RbacObjectNotFoundException.java
deleted file mode 100644 (file)
index 65d6830..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-package org.codehaus.plexus.redback.rbac;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * RbacObjectNotFoundException used by {@link RBACManager} methods to identify
- * when a RBAC Object Was Not Found. 
- *
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- */
-public class RbacObjectNotFoundException
-    extends RbacManagerException
-{
-    private Object object;
-
-    public RbacObjectNotFoundException()
-    {
-        super();
-    }
-
-    public RbacObjectNotFoundException( String message, Throwable cause )
-    {
-        super( message, cause );
-    }
-
-    public RbacObjectNotFoundException( String message, Throwable cause, Object object )
-    {
-        super( message, cause );
-        this.object = object;
-    }
-
-    public RbacObjectNotFoundException( String message )
-    {
-        super( message );
-    }
-
-    public RbacObjectNotFoundException( String message, Object object )
-    {
-        super( message );
-        this.object = object;
-    }
-
-    public RbacObjectNotFoundException( Throwable cause )
-    {
-        super( cause );
-    }
-
-    public Object getObject()
-    {
-        return object;
-    }
-}
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/RbacPermanentException.java b/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/RbacPermanentException.java
deleted file mode 100644 (file)
index 92a3499..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-package org.codehaus.plexus.redback.rbac;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * RbacPermanentException - tossed when a forbidden action against a permanent RBAC Object occurs.  
- *
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- */
-public class RbacPermanentException
-    extends RbacManagerException
-{
-    public RbacPermanentException()
-    {
-        super();
-    }
-
-    public RbacPermanentException( String message, Throwable cause )
-    {
-        super( message, cause );
-    }
-
-    public RbacPermanentException( String message )
-    {
-        super( message );
-    }
-
-    public RbacPermanentException( Throwable cause )
-    {
-        super( cause );
-    }
-}
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/RbacSecurityViolation.java b/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/RbacSecurityViolation.java
deleted file mode 100644 (file)
index a64d5b1..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.codehaus.plexus.redback.rbac;
-
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * Exception thrown when there is a RBAC security violation.
- */
-public class RbacSecurityViolation extends Exception
-{
-    public RbacSecurityViolation( String name )
-    {
-        super( name );
-    }
-}
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/Resource.java b/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/Resource.java
deleted file mode 100644 (file)
index ccac8a6..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-package org.codehaus.plexus.redback.rbac;
-
-/*
- * Copyright 2001-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * Resource
- *
- * Resources are things that can be paired up with operations inside of a
- * permission.
- *
- * Rbac doesn't strictly specify what a resource (or Object) is, so there are a
- * couple of variations planned for resources.
- *
- * Initially the resource is simply a string representaton of whatever you desire
- * to match up to an operation.  Eventually we want to support different types of
- * expression evaluation for these resources, like a tuple resource.  *-* where
- * wildcards can be used on the resource definition to streamline the assigning of
- * permissions for _large_ sets of things.
- *
- * @author Jesse McConnell <jmcconnell@apache.org>
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- */
-public interface Resource
-{
-    /**
-     * Resource identifier refering to all objects.
-     */
-    public static final String GLOBAL = "*";
-
-    /**
-     * Resource identifier refering to no objects.
-     */
-    public static final String NULL = "-";
-
-    /**
-     * Get The string identifier for an operation.
-     *
-     * NOTE: This field is considered the Primary Key for this object.
-     */
-    public String getIdentifier();
-
-    /**
-     * true if the identifer is a pattern that is to be evaluated, for
-     * example x.* could match x.a or x.b and x.** could match x.foo
-     *
-     * Jesse: See {@link #setPattern(boolean)}
-     *
-     */
-    public boolean isPattern();
-
-    /**
-     * Set The string identifier for an operation.
-     *
-     * NOTE: This field is considered the Primary Key for this object.
-     * 
-     * @param identifier
-     */
-    public void setIdentifier( String identifier );
-
-    /**
-     * true if the identifer is a pattern that is to be evaluated, for
-     * example x.* could match x.a or x.b and x.** could match x.foo
-     *
-     * TODO is this even a good idea?
-     * TODO we could look for a character like '*' or a string starting with "%/" to indicate if this is a pattern or not.
-     * 
-     * @param pattern
-     */
-    public void setPattern( boolean pattern );
-
-    /**
-     * Test to see if the object is a permanent object or not.
-     * 
-     * @return true if the object is permanent.
-     */
-    public boolean isPermanent();
-
-    /**
-     * Set flag indicating if the object is a permanent object or not.
-     * 
-     * @param permanent true if the object is permanent.
-     */
-    public void setPermanent( boolean permanent );
-}
\ No newline at end of file
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/Role.java b/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/Role.java
deleted file mode 100644 (file)
index 7f4f2d0..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-package org.codehaus.plexus.redback.rbac;
-
-/*
- * Copyright 2001-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import java.util.List;
-
-/**
- * Role
- * <p/>
- * A role is assignable to a user and effectively grants that user all of the
- * permissions that are present in that role.  A role can also contain other roles
- * which add the permissions in those roles to the available permissions for authorization.
- * <p/>
- * A role can contain any number of permissions
- * A role can contain any number of other roles
- * A role can be assigned to any number of users
- *
- * @author Jesse McConnell <jmcconnell@apache.org>
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- */
-public interface Role
-{
-
-    /**
-     * Method addPermission
-     *
-     * @param permission
-     */
-    void addPermission( Permission permission );
-
-    /**
-     * Method addChildRoleName
-     *
-     * @param name the name of the child role.
-     */
-    void addChildRoleName( String name );
-
-    /**
-     * Method getChildRoleNames
-     */
-    List<String> getChildRoleNames();
-
-    /**
-     * Convienence method to see if Role has Child Roles.
-     *
-     * @return true if child roles exists and has any roles being tracked.
-     */
-    boolean hasChildRoles();
-
-    /**
-     * Long description of the role.
-     */
-    String getDescription();
-
-    /**
-     * Get the name.
-     * <p/>
-     * NOTE: This field is considered the Primary Key for this object.
-     */
-    String getName();
-
-    /**
-     * Method getPermissions
-     */
-    List<Permission> getPermissions();
-
-    /**
-     * true if this role is available to be assigned to a user
-     */
-    boolean isAssignable();
-
-    /**
-     * Method removePermission
-     *
-     * @param permission
-     */
-    void removePermission( Permission permission );
-
-    /**
-     * true if this role is available to be assigned to a user
-     *
-     * @param assignable
-     */
-    void setAssignable( boolean assignable );
-
-    /**
-     * The names of the roles that will inherit the permissions of this role
-     *
-     * @param names the list of names of other roles.
-     */
-    void setChildRoleNames( List<String> names );
-
-    /**
-     * Set the Description
-     *
-     * @param description
-     */
-    void setDescription( String description );
-
-    /**
-     * Set Name
-     * <p/>
-     * NOTE: This field is considered the Primary Key for this object.
-     *
-     * @param name
-     */
-    void setName( String name );
-
-    /**
-     * Set Permissions
-     *
-     * @param permissions
-     */
-    void setPermissions( List<Permission> permissions );
-
-    /**
-     * Test to see if the object is a permanent object or not.
-     *
-     * @return true if the object is permanent.
-     */
-    boolean isPermanent();
-
-    /**
-     * Set flag indicating if the object is a permanent object or not.
-     *
-     * @param permanent true if the object is permanent.
-     */
-    void setPermanent( boolean permanent );
-}
\ No newline at end of file
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/TemplatedRole.java b/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/TemplatedRole.java
deleted file mode 100644 (file)
index e2ed773..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-package org.codehaus.plexus.redback.rbac;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-/**
- * TemplatedRole
- *
- * @author <a href="hisidro@exist.com">Henry Isidro</a>
- */
-public class TemplatedRole
-{
-    private Role role;
-    
-    private String templateNamePrefix;
-    
-    private String delimiter;
-    
-    public TemplatedRole(Role role, String templateNamePrefix, String delimeter)
-    {
-        this.role = role;
-        this.templateNamePrefix = templateNamePrefix;
-        this.delimiter = delimeter;
-    }
-    
-    public String getResource()
-    {
-        int index = role.getName().indexOf( getDelimiter() );
-        
-        return role.getName().substring( index + 3);
-    }
-
-    public Role getRole()
-    {
-        return role;
-    }
-
-    public void setRole( Role role )
-    {
-        this.role = role;
-    }
-
-    public String getTemplateNamePrefix()
-    {
-        return templateNamePrefix;
-    }
-
-    public void setTemplateNamePrefix( String templateNamePrefix )
-    {
-        this.templateNamePrefix = templateNamePrefix;
-    }
-
-    public String getDelimiter()
-    {
-        return delimiter;
-    }
-
-    public void setDelimiter( String delimiter )
-    {
-        this.delimiter = delimiter;
-    }
-
-    public String getName()
-    {
-        return this.role.getName();
-    }
-
-    public void setName( String name )
-    {
-        this.role.setName( name );
-    }
-}
diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/UserAssignment.java b/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/UserAssignment.java
deleted file mode 100644 (file)
index 6e3ef7e..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-package org.codehaus.plexus.redback.rbac;
-
-import java.util.List;
-
-/*
- * Copyright 2001-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * UserAssignment - This the mapping object that takes the principal for a user and associates it with a
- * set of Roles.
- * 
- * This is the many to many mapping object needed by persistence stores.
- *
- * @author Jesse McConnell <jmcconnell@apache.org>
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- * @todo expand on javadoc
- */
-public interface UserAssignment
-{
-
-    
-    /**
-     * The principal for the User that the set of roles is associated with.
-     * 
-     * NOTE: This field is considered the Primary Key for this object.
-     * 
-     * @return the principal for the User.
-     */
-    String getPrincipal();
-
-    /**
-     * Get the roles for this user.
-     * 
-     * @return List of &lt;{@link String}&gt; objects representing the Role Names.
-     */
-    List<String> getRoleNames();
-    
-    /**
-     * Add a rolename to this assignment.
-     * 
-     * @param role the role.
-     */
-    void addRoleName( Role role );
-    
-    /**
-     * Add a rolename to this assignment.
-     * 
-     * @param roleName the role name.
-     */
-    void addRoleName( String roleName );
-    
-    /**
-     * Remove a rolename from this assignment.
-     * 
-     * @param role the role who's name is to be removed.
-     */
-    void removeRoleName( Role role );
-    
-    /**
-     * Remove a role name from this assignment.
-     * 
-     * @param roleName the role name to be removed.
-     */
-    void removeRoleName( String roleName );
-
-    /**
-     * Set the user principal object for this association.
-     * 
-     * NOTE: This field is considered the Primary Key for this object.
-     * 
-     * @param principal
-     */
-    void setPrincipal( String principal );
-
-    /**
-     * Set the roles names for this user.
-     * 
-     * @param roles the List of &lt;{@link String}&gt; objects representing the Role Names.
-     */
-    void setRoleNames( List<String> roles );
-    
-    /**
-     * Test to see if the object is a permanent object or not.
-     * 
-     * @return true if the object is permanent.
-     */
-    boolean isPermanent();
-
-    /**
-     * Set flag indicating if the object is a permanent object or not.
-     * 
-     * @param permanent true if the object is permanent.
-     */
-    void setPermanent( boolean permanent );
-}
\ No newline at end of file
index 720a81646e00ee8c778d962b10b7f67a4e7ea10c..e18568bbc8439c4e502839ef817f21e2eebcfda3 100644 (file)
@@ -19,17 +19,17 @@ package org.codehaus.plexus.redback.rbac.cached;
  * under the License.
  */
 
+import org.apache.archiva.redback.rbac.Operation;
+import org.apache.archiva.redback.rbac.RBACManagerListener;
+import org.apache.archiva.redback.rbac.RbacManagerException;
+import org.apache.archiva.redback.rbac.RbacObjectInvalidException;
+import org.apache.archiva.redback.rbac.RbacObjectNotFoundException;
+import org.apache.archiva.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.UserAssignment;
 import org.codehaus.plexus.cache.Cache;
-import org.codehaus.plexus.redback.rbac.Operation;
-import org.codehaus.plexus.redback.rbac.Permission;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.RBACManagerListener;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.RbacObjectInvalidException;
-import org.codehaus.plexus.redback.rbac.RbacObjectNotFoundException;
-import org.codehaus.plexus.redback.rbac.Resource;
-import org.codehaus.plexus.redback.rbac.Role;
-import org.codehaus.plexus.redback.rbac.UserAssignment;
+import org.apache.archiva.redback.rbac.Permission;
+import org.apache.archiva.redback.rbac.RBACManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
@@ -160,7 +160,7 @@ public class CachedRbacManager
     }
 
     /**
-     * @see org.codehaus.plexus.redback.rbac.RBACManager#getAllAssignableRoles()
+     * @see org.apache.archiva.redback.rbac.RBACManager#getAllAssignableRoles()
      */
     public List<Role> getAllAssignableRoles()
         throws RbacManagerException, RbacObjectNotFoundException
@@ -205,7 +205,7 @@ public class CachedRbacManager
     }
 
     /**
-     * @see org.codehaus.plexus.redback.rbac.RBACManager#getAssignedPermissionMap(java.lang.String)
+     * @see org.apache.archiva.redback.rbac.RBACManager#getAssignedPermissionMap(java.lang.String)
      */
     @SuppressWarnings( "unchecked" )
     public Map getAssignedPermissionMap( String principal )
index b047240797be421fa972f77c24b15b3f9f3f8518..f2d17b977b4b495a6bfe8c88318c4e59f89586f9 100644 (file)
@@ -19,9 +19,7 @@ package org.codehaus.plexus.redback.rbac.cached;
  * under the License.
  */
 
-import net.sf.ehcache.CacheManager;
-
-import org.codehaus.plexus.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.RBACManager;
 import org.codehaus.plexus.redback.tests.AbstractRbacManagerPerformanceTestCase;
 import org.junit.After;
 import org.junit.Before;
index 3b72fa64b6d87e284edd735284152103bd329abd..67ee0fe779e31ff37eb4cee3cf5038ecb771bcab 100644 (file)
@@ -20,7 +20,7 @@ package org.codehaus.plexus.redback.rbac.cached;
  */
 
 import net.sf.ehcache.CacheManager;
-import org.codehaus.plexus.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.RBACManager;
 import org.codehaus.plexus.redback.tests.AbstractRbacManagerTestCase;
 import org.junit.Before;
 
index ceb471602d5270ed191912d8d2ad105c4e1eda76..6eb8a500e061579d8ffd44dc3a80a81c2227ca7c 100644 (file)
@@ -19,18 +19,18 @@ package org.codehaus.plexus.redback.rbac.jdo;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.rbac.AbstractRBACManager;
-import org.codehaus.plexus.redback.rbac.Operation;
-import org.codehaus.plexus.redback.rbac.Permission;
-import org.codehaus.plexus.redback.rbac.RBACManagerListener;
-import org.codehaus.plexus.redback.rbac.RBACObjectAssertions;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.RbacObjectInvalidException;
-import org.codehaus.plexus.redback.rbac.RbacObjectNotFoundException;
-import org.codehaus.plexus.redback.rbac.RbacPermanentException;
-import org.codehaus.plexus.redback.rbac.Resource;
-import org.codehaus.plexus.redback.rbac.Role;
-import org.codehaus.plexus.redback.rbac.UserAssignment;
+import org.apache.archiva.redback.rbac.AbstractRBACManager;
+import org.apache.archiva.redback.rbac.Operation;
+import org.apache.archiva.redback.rbac.RBACManagerListener;
+import org.apache.archiva.redback.rbac.RbacManagerException;
+import org.apache.archiva.redback.rbac.RbacObjectInvalidException;
+import org.apache.archiva.redback.rbac.RbacObjectNotFoundException;
+import org.apache.archiva.redback.rbac.RbacPermanentException;
+import org.apache.archiva.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.UserAssignment;
+import org.apache.archiva.redback.rbac.Permission;
+import org.apache.archiva.redback.rbac.RBACObjectAssertions;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.PostConstruct;
index f9a193c6c91a6441857b4bb3dd842cf355bd6763..a4c18cb8ffdbb0f1e9b567ee9159918a270bd2f5 100644 (file)
@@ -19,12 +19,12 @@ package org.codehaus.plexus.redback.rbac.jdo;
  * under the License.
  */
 
+import org.apache.archiva.redback.rbac.Permission;
+import org.apache.archiva.redback.rbac.RBACManagerListener;
+import org.apache.archiva.redback.rbac.RbacManagerException;
+import org.apache.archiva.redback.rbac.RbacObjectNotFoundException;
+import org.apache.archiva.redback.rbac.Role;
 import org.codehaus.plexus.jdo.JdoFactory;
-import org.codehaus.plexus.redback.rbac.Permission;
-import org.codehaus.plexus.redback.rbac.RBACManagerListener;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.RbacObjectNotFoundException;
-import org.codehaus.plexus.redback.rbac.Role;
 import org.codehaus.plexus.util.StringUtils;
 import org.springframework.stereotype.Service;
 
index ad6f9fe6f0b33f2362b6b9cfd22309219180aa25..966440f0560ee45a97419726b3e6f85efe63acd7 100644 (file)
@@ -85,9 +85,9 @@
       <name>JdoRole</name>
       <version>1.0.0+</version>
       <interfaces>
-        <interface>org.codehaus.plexus.redback.rbac.Role</interface>
+        <interface>org.apache.archiva.redback.rbac.Role</interface>
       </interfaces>
-      <superClass>org.codehaus.plexus.redback.rbac.AbstractRole</superClass>
+      <superClass>org.apache.archiva.redback.rbac.AbstractRole</superClass>
       <fields>
         <field jpox.primary-key="true" jpox.value-strategy="off">
           <name>name</name>
                        jpox.dependent="false"
                        java.generate-break="false" 
                        java.generate-create="false"
-                       zjava.use-interface="org.codehaus.plexus.redback.rbac.Role">
+                       zjava.use-interface="org.apache.archiva.redback.rbac.Role">
             <type>String</type>
             <multiplicity>*</multiplicity>
           </association>
                        java.init="field"
                        java.generate-break="false"
                        java.generate-create="false"
-                       java.use-interface="org.codehaus.plexus.redback.rbac.Permission">
+                       java.use-interface="org.apache.archiva.redback.rbac.Permission">
             <type>JdoPermission</type>
             <multiplicity>*</multiplicity>
           </association>
       <name>JdoPermission</name>
       <version>1.0.0+</version>
       <interfaces>
-        <interface>org.codehaus.plexus.redback.rbac.Permission</interface>
+        <interface>org.apache.archiva.redback.rbac.Permission</interface>
       </interfaces>
       <fields>
         <field jpox.primary-key="true" jpox.value-strategy="off">
           <version>1.0.0+</version>
           <association stash.part="true" 
                        xml.reference="true"
-                       java.use-interface="org.codehaus.plexus.redback.rbac.Operation"
+                       java.use-interface="org.apache.archiva.redback.rbac.Operation"
                        jpox.dependent="false">
             <type>JdoOperation</type>
             <multiplicity>1</multiplicity>
           <version>1.0.0+</version>
           <association stash.part="true" 
                        xml.reference="true"
-                       java.use-interface="org.codehaus.plexus.redback.rbac.Resource"
+                       java.use-interface="org.apache.archiva.redback.rbac.Resource"
                        jpox.dependent="false">
             <type>JdoResource</type>
             <multiplicity>1</multiplicity>
       <name>JdoOperation</name>
       <version>1.0.0+</version>
       <interfaces>
-        <interface>org.codehaus.plexus.redback.rbac.Operation</interface>
+        <interface>org.apache.archiva.redback.rbac.Operation</interface>
       </interfaces>
       <fields>
         <field jpox.primary-key="true" jpox.value-strategy="off">
         In RBAC terms, this is the entity which an operation is associated with that which permissions are based on.
       </description>
       <interfaces>
-        <interface>org.codehaus.plexus.redback.rbac.Resource</interface>
+        <interface>org.apache.archiva.redback.rbac.Resource</interface>
       </interfaces>
       <fields>
         <field jpox.primary-key="true" jpox.value-strategy="off">
       <description>binding of a principal to a role</description>
       <version>1.0.0+</version>
       <interfaces>
-        <interface>org.codehaus.plexus.redback.rbac.UserAssignment</interface>
+        <interface>org.apache.archiva.redback.rbac.UserAssignment</interface>
       </interfaces>
-      <superClass>org.codehaus.plexus.redback.rbac.AbstractUserAssignment</superClass>
+      <superClass>org.apache.archiva.redback.rbac.AbstractUserAssignment</superClass>
       <fields>
         <field jpox.primary-key="true" jpox.value-strategy="off">
           <name>principal</name>
index 853dff678a8e2db7ac892c6d29b7358ab4ed7a94..0485c592128fa15e86826b5dde95e8cb24613848 100644 (file)
@@ -20,10 +20,10 @@ package org.codehaus.plexus.redback.rbac.jdo;
  */
 
 import net.sf.ehcache.CacheManager;
+import org.apache.archiva.redback.rbac.RbacManagerException;
 import org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory;
 import org.apache.archiva.redback.common.jdo.test.StoreManagerDebug;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
+import org.apache.archiva.redback.rbac.RBACManager;
 import org.codehaus.plexus.redback.tests.AbstractRbacManagerTestCase;
 import org.jpox.AbstractPersistenceManagerFactory;
 import org.jpox.SchemaTool;
index 77c93a3170629923ff5abc45669004904a0c4aec..c2daaa677d7bc4845c0a70049e4a72fc0ccd8265 100644 (file)
@@ -31,8 +31,8 @@ import javax.xml.stream.XMLStreamException;
 
 import junit.framework.TestCase;
 
-import org.codehaus.plexus.redback.rbac.Operation;
-import org.codehaus.plexus.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.Operation;
+import org.apache.archiva.redback.rbac.Resource;
 import org.codehaus.plexus.redback.rbac.jdo.io.stax.RbacJdoModelStaxReader;
 import org.codehaus.plexus.redback.rbac.jdo.io.stax.RbacJdoModelStaxWriter;
 
index 5be9c162371449043c6df656b02fa33689d5b2f2..c4856ebdad97f7fffa3dbe31eec56a294ad03074 100644 (file)
@@ -19,7 +19,7 @@ package org.codehaus.plexus.redback.rbac.memory;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.rbac.Operation;
+import org.apache.archiva.redback.rbac.Operation;
 
 /**
  * MemoryOperation 
index f83e7f9fe089fc78cbb178cc5f1bd086f1f15d08..476c557bfcce5c541f92a339c5feb93cbbff04be 100644 (file)
@@ -19,9 +19,9 @@ package org.codehaus.plexus.redback.rbac.memory;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.rbac.Operation;
-import org.codehaus.plexus.redback.rbac.Permission;
-import org.codehaus.plexus.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.Operation;
+import org.apache.archiva.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.Permission;
 
 /**
  * MemoryPermission 
index 2b4a042d294a62357b2acb3b797d7c6fe50f8894..2336f823672930479716adbc4257e43a799b11f3 100644 (file)
@@ -19,18 +19,18 @@ package org.codehaus.plexus.redback.rbac.memory;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.rbac.AbstractRBACManager;
-import org.codehaus.plexus.redback.rbac.Operation;
-import org.codehaus.plexus.redback.rbac.Permission;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.RBACObjectAssertions;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.RbacObjectInvalidException;
-import org.codehaus.plexus.redback.rbac.RbacObjectNotFoundException;
-import org.codehaus.plexus.redback.rbac.RbacPermanentException;
-import org.codehaus.plexus.redback.rbac.Resource;
-import org.codehaus.plexus.redback.rbac.Role;
-import org.codehaus.plexus.redback.rbac.UserAssignment;
+import org.apache.archiva.redback.rbac.AbstractRBACManager;
+import org.apache.archiva.redback.rbac.Operation;
+import org.apache.archiva.redback.rbac.Permission;
+import org.apache.archiva.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.RBACObjectAssertions;
+import org.apache.archiva.redback.rbac.RbacManagerException;
+import org.apache.archiva.redback.rbac.RbacObjectInvalidException;
+import org.apache.archiva.redback.rbac.RbacObjectNotFoundException;
+import org.apache.archiva.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.UserAssignment;
+import org.apache.archiva.redback.rbac.RbacPermanentException;
 import org.codehaus.plexus.util.StringUtils;
 import org.springframework.stereotype.Service;
 
index 249a950e80d3d133c9da2693ea3ee92e68446f46..0e994620872dedc535b5a1b8b257828f903ece4f 100644 (file)
@@ -19,7 +19,7 @@ package org.codehaus.plexus.redback.rbac.memory;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.Resource;
 
 /**
  * MemoryResource 
index fe750598a3cb9d8395c7adf9e27f4489a9dcdd7f..7105d654dc9843421aa022a953f36538b0a3e319 100644 (file)
@@ -19,9 +19,9 @@ package org.codehaus.plexus.redback.rbac.memory;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.rbac.AbstractRole;
-import org.codehaus.plexus.redback.rbac.Permission;
-import org.codehaus.plexus.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.AbstractRole;
+import org.apache.archiva.redback.rbac.Permission;
+import org.apache.archiva.redback.rbac.Role;
 
 import java.util.ArrayList;
 import java.util.List;
index 1f7111faef7ff3d696dc98171353f8a319fea2bc..f1afeed774ad6e4c53ea0a621cbe9b19fa59fb9c 100644 (file)
@@ -19,8 +19,8 @@ package org.codehaus.plexus.redback.rbac.memory;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.rbac.AbstractUserAssignment;
-import org.codehaus.plexus.redback.rbac.UserAssignment;
+import org.apache.archiva.redback.rbac.AbstractUserAssignment;
+import org.apache.archiva.redback.rbac.UserAssignment;
 
 import java.util.ArrayList;
 import java.util.List;
index 64141137bf1075c739fa675c6e385b43a3fc0132..78eb7ccb9b60c136a6fd274d342e8b19efb5219c 100644 (file)
@@ -19,9 +19,7 @@ package org.codehaus.plexus.redback.rbac.memory;
  * under the License.
  */
 
-import net.sf.ehcache.CacheManager;
-
-import org.codehaus.plexus.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.RBACManager;
 import org.codehaus.plexus.redback.tests.AbstractRbacManagerTestCase;
 import org.junit.Before;
 
index 656c72063800416e2c98e5c8efe60813314b1837..25167afc2362fd79325b2b6a3933339647929b8d 100644 (file)
@@ -19,12 +19,12 @@ package org.codehaus.plexus.redback.role;
  * under the License.
  */
 
+import org.apache.archiva.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.RbacManagerException;
+import org.apache.archiva.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.UserAssignment;
 import org.apache.commons.lang.SystemUtils;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.Resource;
-import org.codehaus.plexus.redback.rbac.Role;
-import org.codehaus.plexus.redback.rbac.UserAssignment;
+import org.apache.archiva.redback.rbac.Resource;
 import org.codehaus.plexus.redback.role.model.ModelApplication;
 import org.codehaus.plexus.redback.role.model.ModelRole;
 import org.codehaus.plexus.redback.role.model.ModelTemplate;
index e891426009299d204976973533335fc90026a6f9..ded258c966569aa30e69649425846cd6663906f0 100644 (file)
@@ -19,12 +19,12 @@ package org.codehaus.plexus.redback.role.processor;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.rbac.Operation;
-import org.codehaus.plexus.redback.rbac.Permission;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.Resource;
-import org.codehaus.plexus.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.Operation;
+import org.apache.archiva.redback.rbac.Permission;
+import org.apache.archiva.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.RbacManagerException;
+import org.apache.archiva.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.Role;
 import org.codehaus.plexus.redback.role.RoleManagerException;
 import org.codehaus.plexus.redback.role.model.ModelApplication;
 import org.codehaus.plexus.redback.role.model.ModelOperation;
index 621a95e7f36535f9499a6e7f0d6656c8a3443371..4d2362cc1d067dd16ac5bcfe37b7181cf18a05be 100644 (file)
@@ -19,12 +19,12 @@ package org.codehaus.plexus.redback.role.template;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.rbac.Operation;
-import org.codehaus.plexus.redback.rbac.Permission;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.Resource;
-import org.codehaus.plexus.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.Operation;
+import org.apache.archiva.redback.rbac.Permission;
+import org.apache.archiva.redback.rbac.RbacManagerException;
+import org.apache.archiva.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.RBACManager;
 import org.codehaus.plexus.redback.role.RoleManagerException;
 import org.codehaus.plexus.redback.role.model.ModelApplication;
 import org.codehaus.plexus.redback.role.model.ModelOperation;
index 40289693c65cdaae5e6233f12e737d8a710fc986..79d945b920e644b8e659afb3a81323b25b77446f 100644 (file)
@@ -20,11 +20,11 @@ package org.codehaus.plexus.redback.role;
  */
 
 import junit.framework.TestCase;
-import org.codehaus.plexus.redback.rbac.Permission;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.Resource;
-import org.codehaus.plexus.redback.rbac.Role;
-import org.codehaus.plexus.redback.rbac.UserAssignment;
+import org.apache.archiva.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.Permission;
+import org.apache.archiva.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.UserAssignment;
 import org.codehaus.plexus.redback.role.model.ModelPermission;
 import org.codehaus.plexus.redback.role.model.ModelTemplate;
 import org.codehaus.plexus.redback.role.util.RoleModelUtils;
index 4f02a3c3ca57c519ce273c083d299bea3b73b388..594b69b0af8ff8a1a2b82884f84edbf355c7a8d6 100644 (file)
@@ -19,12 +19,8 @@ package org.codehaus.plexus.redback.role;
  * under the License.
  */
 
-import net.sf.ehcache.CacheManager;
 import org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory;
-import org.codehaus.plexus.redback.rbac.RBACManager;
 import org.codehaus.plexus.redback.rbac.jdo.JdoRbacManager;
-import org.codehaus.plexus.redback.rbac.jdo.JdoTool;
-import org.jpox.SchemaTool;
 import org.junit.Before;
 import org.junit.runner.RunWith;
 import org.springframework.test.context.ContextConfiguration;
@@ -34,10 +30,6 @@ import javax.inject.Inject;
 import javax.inject.Named;
 import javax.jdo.PersistenceManager;
 import javax.jdo.PersistenceManagerFactory;
-import java.io.File;
-import java.net.URL;
-import java.util.Map;
-import java.util.Properties;
 
 /**
  * RoleManagerTest:
index 9a0f6e1550d05fea0e7383c5795a9990790c3d5c..cf59289d8e8f90cde8ee984d3ca4d761a6da8cd8 100644 (file)
@@ -20,7 +20,7 @@ package org.codehaus.plexus.redback.role;
  */
 
 import net.sf.ehcache.CacheManager;
-import org.codehaus.plexus.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.RBACManager;
 import org.junit.Before;
 
 import javax.inject.Inject;
index 0337270ff38bf2d2ff675f988a1b4f9c611b54c1..27e65dc8c397a92834e566b5381001a19fb4cd13 100644 (file)
@@ -20,9 +20,9 @@ package org.codehaus.plexus.redback.role.processor;
  */
 
 import junit.framework.TestCase;
-import org.codehaus.plexus.redback.rbac.Permission;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.Permission;
+import org.apache.archiva.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.Role;
 import org.codehaus.plexus.redback.role.RoleManagerException;
 import org.codehaus.plexus.redback.role.model.RedbackRoleModel;
 import org.codehaus.plexus.redback.role.model.io.stax.RedbackRoleModelStaxReader;
index 485790d53016170d03c5f107f614409526808dc9..5e2828300251a68a2602ecd6172c46bbfdac3d58 100644 (file)
@@ -20,9 +20,9 @@ package org.codehaus.plexus.redback.role.template;
  */
 
 import junit.framework.TestCase;
-import org.codehaus.plexus.redback.rbac.Permission;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.Permission;
+import org.apache.archiva.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.Role;
 import org.codehaus.plexus.redback.role.model.ModelTemplate;
 import org.codehaus.plexus.redback.role.model.RedbackRoleModel;
 import org.codehaus.plexus.redback.role.model.io.stax.RedbackRoleModelStaxReader;
index 71f8a864124d97dc98b812a64a6b34017add70e9..de09ba39cc3c8b671f87079c6f87fe91c31325e7 100644 (file)
@@ -19,13 +19,13 @@ package org.codehaus.plexus.redback.tests;
  * under the License.
  */
 import junit.framework.TestCase;
-import org.codehaus.plexus.redback.rbac.Operation;
-import org.codehaus.plexus.redback.rbac.Permission;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.Resource;
-import org.codehaus.plexus.redback.rbac.Role;
-import org.codehaus.plexus.redback.rbac.UserAssignment;
+import org.apache.archiva.redback.rbac.Permission;
+import org.apache.archiva.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.RbacManagerException;
+import org.apache.archiva.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.UserAssignment;
+import org.apache.archiva.redback.rbac.Operation;
 import org.codehaus.plexus.redback.tests.utils.RBACDefaults;
 import org.junit.Test;
 import org.junit.runner.RunWith;
index c22a34a1b7163c4270018bb63c2ff343710af302..47a458c2696881e6924a114b8f4f0981b2edf714 100644 (file)
@@ -17,14 +17,14 @@ package org.codehaus.plexus.redback.tests;
  */
 
 import junit.framework.TestCase;
-import org.codehaus.plexus.redback.rbac.Operation;
-import org.codehaus.plexus.redback.rbac.Permission;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.RbacPermanentException;
-import org.codehaus.plexus.redback.rbac.Resource;
-import org.codehaus.plexus.redback.rbac.Role;
-import org.codehaus.plexus.redback.rbac.UserAssignment;
+import org.apache.archiva.redback.rbac.Operation;
+import org.apache.archiva.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.RbacManagerException;
+import org.apache.archiva.redback.rbac.Resource;
+import org.apache.archiva.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.UserAssignment;
+import org.apache.archiva.redback.rbac.Permission;
+import org.apache.archiva.redback.rbac.RbacPermanentException;
 import org.codehaus.plexus.redback.tests.utils.RBACDefaults;
 import org.junit.Test;
 import org.junit.runner.RunWith;
index 4806ef2e4fae56087134db774e567e9a1691983f..79a551033080ba800714e8efa2f130001391d3de 100644 (file)
@@ -19,10 +19,10 @@ package org.codehaus.plexus.redback.tests;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.rbac.Permission;
-import org.codehaus.plexus.redback.rbac.RBACManagerListener;
-import org.codehaus.plexus.redback.rbac.Role;
-import org.codehaus.plexus.redback.rbac.UserAssignment;
+import org.apache.archiva.redback.rbac.RBACManagerListener;
+import org.apache.archiva.redback.rbac.Permission;
+import org.apache.archiva.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.UserAssignment;
 
 import java.util.ArrayList;
 import java.util.List;
index 2613b739ec004f15005e3586e373aede45b274a3..aa1f0a477ca8b65a33c60b86db830854003bd447 100644 (file)
@@ -16,11 +16,11 @@ package org.codehaus.plexus.redback.tests.utils;
  * limitations under the License.
  */
 
-import org.codehaus.plexus.redback.rbac.Operation;
-import org.codehaus.plexus.redback.rbac.Permission;
-import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.Permission;
+import org.apache.archiva.redback.rbac.Operation;
+import org.apache.archiva.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.Role;
+import org.apache.archiva.redback.rbac.RbacManagerException;
 
 public class RBACDefaults
 {