* under the License.
*/
-import java.util.Comparator;
+import org.apache.archiva.redback.role.model.ModelTemplate;
-import org.codehaus.plexus.redback.role.model.ModelTemplate;
+import java.util.Comparator;
/**
* ModelTemplateSorter
import org.apache.archiva.redback.rbac.UserAssignment;
import org.apache.archiva.redback.role.RoleManager;
import org.apache.archiva.redback.role.RoleManagerException;
+import org.apache.archiva.redback.role.model.ModelApplication;
+import org.apache.archiva.redback.role.model.ModelRole;
+import org.apache.archiva.redback.role.model.ModelTemplate;
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.role.model.ModelApplication;
-import org.codehaus.plexus.redback.role.model.ModelRole;
-import org.codehaus.plexus.redback.role.model.ModelTemplate;
import org.apache.archiva.redback.integration.model.AdminEditUserCredentials;
import org.apache.archiva.redback.integration.security.role.RedbackRoleConstants;
import org.apache.archiva.redback.integration.util.RoleSorter;
import org.apache.archiva.redback.rbac.Role;
import org.apache.archiva.redback.rbac.UserAssignment;
import org.apache.archiva.redback.role.RoleManager;
+import org.apache.archiva.redback.role.model.ModelApplication;
import org.apache.archiva.redback.struts2.action.AbstractUserCredentialsAction;
import org.apache.archiva.redback.users.User;
import org.apache.archiva.redback.users.UserNotFoundException;
import org.apache.archiva.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.role.model.ModelApplication;
import org.apache.archiva.redback.struts2.action.AuditEvent;
import org.apache.archiva.redback.struts2.model.ApplicationRoleDetails;
import org.apache.archiva.redback.struts2.model.ApplicationRoleDetails.RoleTableCell;
import org.apache.archiva.redback.rbac.Resource;
import org.apache.archiva.redback.role.RoleManager;
+import org.apache.archiva.redback.role.model.RedbackRoleModel;
import org.apache.archiva.redback.struts2.action.AbstractSecurityAction;
-import org.codehaus.plexus.redback.role.model.RedbackRoleModel;
import org.apache.archiva.redback.integration.interceptor.SecureActionBundle;
import org.apache.archiva.redback.integration.interceptor.SecureActionException;
import org.apache.archiva.redback.integration.role.RoleConstants;
*/
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;
+import org.apache.archiva.redback.role.model.ModelApplication;
+import org.apache.archiva.redback.role.model.ModelRole;
+import org.apache.archiva.redback.role.model.ModelTemplate;
import java.util.ArrayList;
import java.util.Collection;
private List<List<RoleTableCell>> table;
- @SuppressWarnings("unchecked")
+ @SuppressWarnings( "unchecked" )
public ApplicationRoleDetails( ModelApplication application, Collection<Role> effectivelyAssignedRoles,
Collection<Role> allAssignedRoles, List<Role> assignableRoles )
{
availableRoles = new ArrayList<String>();
for ( Iterator<ModelRole> i = applicationRoles.iterator(); i.hasNext(); )
{
- ModelRole role = i.next();
+ ModelRole role = i.next();
if ( isInList( role.getName(), allAssignedRoles ) )
{
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.role.model.ModelApplication;
+import org.apache.archiva.redback.role.model.ModelRole;
+import org.apache.archiva.redback.role.model.ModelTemplate;
+import org.apache.archiva.redback.role.model.RedbackRoleModel;
+import org.apache.archiva.redback.role.model.io.stax.RedbackRoleModelStaxReader;
import org.apache.archiva.redback.role.processor.RoleModelProcessor;
import org.apache.commons.lang.SystemUtils;
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;
-import org.codehaus.plexus.redback.role.model.RedbackRoleModel;
-import org.codehaus.plexus.redback.role.model.io.stax.RedbackRoleModelStaxReader;
import org.apache.archiva.redback.role.template.RoleTemplateProcessor;
import org.apache.archiva.redback.role.util.RoleModelUtils;
import org.apache.archiva.redback.role.validator.RoleModelValidator;
* under the License.
*/
-import org.codehaus.plexus.redback.role.model.RedbackRoleModel;
+import org.apache.archiva.redback.role.model.RedbackRoleModel;
import java.net.URL;
import org.apache.archiva.redback.rbac.Resource;
import org.apache.archiva.redback.rbac.Role;
import org.apache.archiva.redback.role.RoleManagerException;
-import org.codehaus.plexus.redback.role.model.ModelApplication;
-import org.codehaus.plexus.redback.role.model.ModelOperation;
-import org.codehaus.plexus.redback.role.model.ModelPermission;
-import org.codehaus.plexus.redback.role.model.ModelResource;
-import org.codehaus.plexus.redback.role.model.ModelRole;
-import org.codehaus.plexus.redback.role.model.RedbackRoleModel;
+import org.apache.archiva.redback.role.model.ModelApplication;
+import org.apache.archiva.redback.role.model.ModelOperation;
+import org.apache.archiva.redback.role.model.ModelPermission;
+import org.apache.archiva.redback.role.model.ModelResource;
+import org.apache.archiva.redback.role.model.ModelRole;
+import org.apache.archiva.redback.role.model.RedbackRoleModel;
import org.apache.archiva.redback.role.util.RoleModelUtils;
import org.codehaus.plexus.util.dag.CycleDetectedException;
import org.slf4j.Logger;
*/
import org.apache.archiva.redback.role.RoleManagerException;
-import org.codehaus.plexus.redback.role.model.RedbackRoleModel;
+import org.apache.archiva.redback.role.model.RedbackRoleModel;
/**
* RoleModelValidator:
import org.apache.archiva.redback.rbac.Role;
import org.apache.archiva.redback.rbac.RBACManager;
import org.apache.archiva.redback.role.RoleManagerException;
-import org.codehaus.plexus.redback.role.model.ModelApplication;
-import org.codehaus.plexus.redback.role.model.ModelOperation;
-import org.codehaus.plexus.redback.role.model.ModelPermission;
-import org.codehaus.plexus.redback.role.model.ModelResource;
-import org.codehaus.plexus.redback.role.model.ModelRole;
-import org.codehaus.plexus.redback.role.model.ModelTemplate;
-import org.codehaus.plexus.redback.role.model.RedbackRoleModel;
+import org.apache.archiva.redback.role.model.ModelApplication;
+import org.apache.archiva.redback.role.model.ModelOperation;
+import org.apache.archiva.redback.role.model.ModelPermission;
+import org.apache.archiva.redback.role.model.ModelResource;
+import org.apache.archiva.redback.role.model.ModelRole;
+import org.apache.archiva.redback.role.model.ModelTemplate;
+import org.apache.archiva.redback.role.model.RedbackRoleModel;
import org.apache.archiva.redback.role.util.RoleModelUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
*/
import org.apache.archiva.redback.role.RoleManagerException;
-import org.codehaus.plexus.redback.role.model.RedbackRoleModel;
+import org.apache.archiva.redback.role.model.RedbackRoleModel;
/**
* RoleModelValidator:
* under the License.
*/
-import org.codehaus.plexus.redback.role.model.ModelApplication;
-import org.codehaus.plexus.redback.role.model.ModelOperation;
-import org.codehaus.plexus.redback.role.model.ModelResource;
-import org.codehaus.plexus.redback.role.model.ModelRole;
-import org.codehaus.plexus.redback.role.model.ModelTemplate;
-import org.codehaus.plexus.redback.role.model.RedbackRoleModel;
+import org.apache.archiva.redback.role.model.ModelApplication;
+import org.apache.archiva.redback.role.model.ModelOperation;
+import org.apache.archiva.redback.role.model.ModelResource;
+import org.apache.archiva.redback.role.model.ModelRole;
+import org.apache.archiva.redback.role.model.ModelTemplate;
+import org.apache.archiva.redback.role.model.RedbackRoleModel;
import org.codehaus.plexus.util.dag.CycleDetectedException;
import org.codehaus.plexus.util.dag.DAG;
import org.codehaus.plexus.util.dag.TopologicalSorter;
* specific language governing permissions and limitations
* under the License.
*/
-import java.util.ArrayList;
-import java.util.List;
import org.apache.archiva.redback.role.RoleManagerException;
-import org.codehaus.plexus.redback.role.model.ModelApplication;
-import org.codehaus.plexus.redback.role.model.ModelOperation;
-import org.codehaus.plexus.redback.role.model.ModelPermission;
-import org.codehaus.plexus.redback.role.model.ModelResource;
-import org.codehaus.plexus.redback.role.model.ModelRole;
-import org.codehaus.plexus.redback.role.model.ModelTemplate;
-import org.codehaus.plexus.redback.role.model.RedbackRoleModel;
+import org.apache.archiva.redback.role.model.ModelApplication;
+import org.apache.archiva.redback.role.model.ModelOperation;
+import org.apache.archiva.redback.role.model.ModelPermission;
+import org.apache.archiva.redback.role.model.ModelResource;
+import org.apache.archiva.redback.role.model.ModelRole;
+import org.apache.archiva.redback.role.model.ModelTemplate;
+import org.apache.archiva.redback.role.model.RedbackRoleModel;
import org.apache.archiva.redback.role.util.RoleModelUtils;
import org.codehaus.plexus.util.dag.CycleDetectedException;
import org.springframework.stereotype.Service;
+import java.util.ArrayList;
+import java.util.List;
+
/**
* DefaultRoleModelValidator: validates completeness of the model
*
* @author: Jesse McConnell <jesse@codehaus.org>
* @version: $Id$
- *
*/
-@Service("roleModelValidator")
+@Service( "roleModelValidator" )
public class DefaultRoleModelValidator
implements RoleModelValidator
{
{
if ( validationErrors == null )
{
- validationErrors = new ArrayList<String>(0);
+ validationErrors = new ArrayList<String>( 0 );
}
validationErrors.add( error );
/**
* FIXME this should be taken care of by <required/> in modello, figure out why its not
* in the meantime, implement the basics
- *
+ *
* @param model
*/
- @SuppressWarnings("unchecked")
+ @SuppressWarnings( "unchecked" )
private void validateRequiredStructure( RedbackRoleModel model )
{
// validate model has name
*
* @param model
*/
- @SuppressWarnings("unchecked")
+ @SuppressWarnings( "unchecked" )
private void validateOperationClosure( RedbackRoleModel model )
{
List<String> operationIdList = RoleModelUtils.getOperationIdList( model );
if ( !operationIdList.contains( permission.getOperation() ) )
{
addValidationError( "missing operation: " + permission.getOperation() + " in permission "
- + permission.getId() );
+ + permission.getId() );
}
}
}
if ( !operationIdList.contains( permission.getOperation() ) )
{
addValidationError( "missing operation: " + permission.getOperation() + " in permission "
- + permission.getId() );
+ + permission.getId() );
}
}
}
}
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings( "unchecked" )
private void validateResourceClosure( RedbackRoleModel model )
{
List<String> resourceIdList = RoleModelUtils.getResourceIdList( model );
if ( !resourceIdList.contains( permission.getResource() ) )
{
addValidationError( "missing operation: " + permission.getResource() + " in permission "
- + permission.getId() );
+ + permission.getId() );
}
}
}
}
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings( "unchecked" )
private void validateChildRoleClosure( RedbackRoleModel model )
{
List<String> roleIdList = RoleModelUtils.getRoleIdList( model );
{
if ( !roleIdList.contains( childRoleId ) )
{
- addValidationError( "missing role id: " + childRoleId + " in child roles of role "
- + role.getId() );
+ addValidationError(
+ "missing role id: " + childRoleId + " in child roles of role " + role.getId() );
}
}
}
{
if ( !roleIdList.contains( childRoleId ) )
{
- addValidationError( "missing role id: " + childRoleId + " in child roles of template "
- + template.getId() );
+ addValidationError(
+ "missing role id: " + childRoleId + " in child roles of template " + template.getId() );
}
}
}
}
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings( "unchecked" )
private void validateParentRoleClosure( RedbackRoleModel model )
{
List roleIdList = RoleModelUtils.getRoleIdList( model );
{
if ( !roleIdList.contains( parentRoleId ) )
{
- addValidationError( "missing role id: " + parentRoleId + " in parent roles of role "
- + role.getId() );
+ addValidationError(
+ "missing role id: " + parentRoleId + " in parent roles of role " + role.getId() );
}
}
}
if ( !roleIdList.contains( parentRoleId ) )
{
addValidationError( "missing role id: " + parentRoleId + " in parent roles of template "
- + template.getId() );
+ + template.getId() );
}
}
}
}
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings( "unchecked" )
private void validateTemplateClosure( RedbackRoleModel model )
{
List templateIdList = RoleModelUtils.getTemplateIdList( model );
{
if ( !templateIdList.contains( parentTemplateId ) )
{
- addValidationError( "missing template id: " + parentTemplateId
- + " in parent templates of template " + template.getId() );
+ addValidationError(
+ "missing template id: " + parentTemplateId + " in parent templates of template "
+ + template.getId() );
}
}
}
{
if ( !templateIdList.contains( childTemplateId ) )
{
- addValidationError( "missing template id: " + childTemplateId
- + " in child templates of template " + template.getId() );
+ addValidationError(
+ "missing template id: " + childTemplateId + " in child templates of template "
+ + template.getId() );
}
}
}
/**
* We are not allowed to have cycles between roles, this method is to detect and raise a red flag when that happens.
- *
+ *
* @param model
*/
private void validateNoRoleCycles( RedbackRoleModel model )
}
/**
- * We are not allowed to have cycles between template either, this method is to detect and
+ * We are not allowed to have cycles between template either, this method is to detect and
* raise a red flag when that happens. Templates are a bit more complex since they have both
* child and parent roles, as well as runtime parent and child templates
- *
+ * <p/>
* the id should be sufficient to test cycles here even though in runtime the id's do not need to be
* unique since it is the binding of a namePrefix and a resource that makes them unique
- *
+ *
* @param model
*/
private void validateNoTemplateCycles( RedbackRoleModel model )
*/
import org.apache.archiva.redback.role.RoleManagerException;
-import org.codehaus.plexus.redback.role.model.RedbackRoleModel;
+import org.apache.archiva.redback.role.model.RedbackRoleModel;
import java.util.List;
<defaults>
<default>
<key>package</key>
- <value>org.codehaus.plexus.redback.role.model</value>
+ <value>org.apache.archiva.redback.role.model</value>
</default>
</defaults>
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.role.RoleManager;
-import org.codehaus.plexus.redback.role.model.ModelPermission;
-import org.codehaus.plexus.redback.role.model.ModelTemplate;
+import org.apache.archiva.redback.role.model.ModelPermission;
+import org.apache.archiva.redback.role.model.ModelTemplate;
import org.apache.archiva.redback.role.util.RoleModelUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.apache.archiva.redback.rbac.RBACManager;
import org.apache.archiva.redback.rbac.Role;
import org.apache.archiva.redback.role.RoleManagerException;
-import org.apache.archiva.redback.role.processor.RoleModelProcessor;
-import org.codehaus.plexus.redback.role.model.RedbackRoleModel;
-import org.codehaus.plexus.redback.role.model.io.stax.RedbackRoleModelStaxReader;
+import org.apache.archiva.redback.role.model.RedbackRoleModel;
+import org.apache.archiva.redback.role.model.io.stax.RedbackRoleModelStaxReader;
import org.apache.archiva.redback.role.validator.RoleModelValidator;
import org.junit.Before;
import org.junit.Test;
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.role.template.RoleTemplateProcessor;
-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;
+import org.apache.archiva.redback.role.model.ModelTemplate;
+import org.apache.archiva.redback.role.model.RedbackRoleModel;
+import org.apache.archiva.redback.role.model.io.stax.RedbackRoleModelStaxReader;
import org.apache.archiva.redback.role.processor.RoleModelProcessor;
import org.apache.archiva.redback.role.util.RoleModelUtils;
import org.junit.Test;
*/
import junit.framework.TestCase;
-import org.apache.archiva.redback.role.validator.RoleModelValidator;
-import org.codehaus.plexus.redback.role.model.RedbackRoleModel;
-import org.codehaus.plexus.redback.role.model.io.stax.RedbackRoleModelStaxReader;
+import org.apache.archiva.redback.role.model.RedbackRoleModel;
+import org.apache.archiva.redback.role.model.io.stax.RedbackRoleModelStaxReader;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;