fix compilation issues
git-svn-id: https://svn.apache.org/repos/asf/archiva/redback/redback-core/trunk@1433402 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
aa677e08c9
commit
abefbdb136
|
@ -439,6 +439,8 @@ public class DefaultRoleManager
|
|||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( rbacManager.roleExists( modelRole.getName() ) )
|
||||
{
|
||||
|
@ -451,6 +453,11 @@ public class DefaultRoleManager
|
|||
"breakdown in role management, role exists in configuration but was not created in underlying store" );
|
||||
}
|
||||
}
|
||||
catch ( RbacManagerException e )
|
||||
{
|
||||
throw new RoleManagerException( e.getMessage(), e );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean templatedRoleExists( String templateId, String resource )
|
||||
|
@ -464,6 +471,8 @@ public class DefaultRoleManager
|
|||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( rbacManager.roleExists( modelTemplate.getNamePrefix() + modelTemplate.getDelimiter() + resource ) )
|
||||
{
|
||||
|
@ -474,6 +483,11 @@ public class DefaultRoleManager
|
|||
return false;
|
||||
}
|
||||
}
|
||||
catch ( RbacManagerException e )
|
||||
{
|
||||
throw new RoleManagerException( e.getMessage(), e );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
|
|
|
@ -49,16 +49,15 @@ import java.util.Map;
|
|||
* DefaultRoleModelProcessor: inserts the components of the model that can be populated into the rbac manager
|
||||
*
|
||||
* @author: Jesse McConnell <jesse@codehaus.org>
|
||||
*
|
||||
*/
|
||||
@Service( "roleModelProcessor" )
|
||||
@Service("roleModelProcessor")
|
||||
public class DefaultRoleModelProcessor
|
||||
implements RoleModelProcessor
|
||||
{
|
||||
private Logger log = LoggerFactory.getLogger( DefaultRoleModelProcessor.class );
|
||||
|
||||
@Inject
|
||||
@Named( value = "rbacManager#cached" )
|
||||
@Named(value = "rbacManager#cached")
|
||||
private RBACManager rbacManager;
|
||||
|
||||
private Map<String, Resource> resourceMap = new HashMap<String, Resource>();
|
||||
|
@ -76,7 +75,7 @@ public class DefaultRoleModelProcessor
|
|||
processRoles( model );
|
||||
}
|
||||
|
||||
@SuppressWarnings( "unchecked" )
|
||||
@SuppressWarnings("unchecked")
|
||||
private void processResources( RedbackRoleModel model )
|
||||
throws RoleManagerException
|
||||
{
|
||||
|
@ -111,7 +110,7 @@ public class DefaultRoleModelProcessor
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings( "unchecked" )
|
||||
@SuppressWarnings("unchecked")
|
||||
private void processOperations( RedbackRoleModel model )
|
||||
throws RoleManagerException
|
||||
{
|
||||
|
@ -148,7 +147,7 @@ public class DefaultRoleModelProcessor
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings( "unchecked" )
|
||||
@SuppressWarnings("unchecked")
|
||||
private void processRoles( RedbackRoleModel model )
|
||||
throws RoleManagerException
|
||||
{
|
||||
|
@ -168,7 +167,18 @@ public class DefaultRoleModelProcessor
|
|||
|
||||
List<Permission> permissions = processPermissions( roleProfile.getPermissions() );
|
||||
|
||||
if ( !rbacManager.roleExists( roleProfile.getName() ) )
|
||||
boolean roleExists = false;
|
||||
|
||||
try
|
||||
{
|
||||
roleExists = rbacManager.roleExists( roleProfile.getName() );
|
||||
}
|
||||
catch ( RbacManagerException e )
|
||||
{
|
||||
throw new RoleManagerException( e.getMessage(), e );
|
||||
}
|
||||
|
||||
if ( !roleExists )
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
|
@ -50,17 +50,17 @@ import java.util.List;
|
|||
*
|
||||
* @author: Jesse McConnell <jesse@codehaus.org>
|
||||
*/
|
||||
@Service( "roleTemplateProcessor" )
|
||||
@Service("roleTemplateProcessor")
|
||||
public class DefaultRoleTemplateProcessor
|
||||
implements RoleTemplateProcessor
|
||||
{
|
||||
private Logger log = LoggerFactory.getLogger( DefaultRoleTemplateProcessor.class );
|
||||
|
||||
@Inject
|
||||
@Named( value = "rbacManager#cached" )
|
||||
@Named(value = "rbacManager#cached")
|
||||
private RBACManager rbacManager;
|
||||
|
||||
@SuppressWarnings( "unchecked" )
|
||||
@SuppressWarnings("unchecked")
|
||||
public void create( RedbackRoleModel model, String templateId, String resource )
|
||||
throws RoleManagerException
|
||||
{
|
||||
|
@ -84,7 +84,7 @@ public class DefaultRoleTemplateProcessor
|
|||
throw new RoleManagerException( "unknown template '" + templateId + "'" );
|
||||
}
|
||||
|
||||
@SuppressWarnings( "unchecked" )
|
||||
@SuppressWarnings("unchecked")
|
||||
public void remove( RedbackRoleModel model, String templateId, String resource )
|
||||
throws RoleManagerException
|
||||
{
|
||||
|
@ -173,7 +173,7 @@ public class DefaultRoleTemplateProcessor
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings( "unchecked" )
|
||||
@SuppressWarnings("unchecked")
|
||||
private void processTemplate( RedbackRoleModel model, ModelTemplate template, String resource )
|
||||
throws RoleManagerException
|
||||
{
|
||||
|
@ -181,7 +181,18 @@ public class DefaultRoleTemplateProcessor
|
|||
|
||||
List<Permission> permissions = processPermissions( model, template, resource );
|
||||
|
||||
if ( !rbacManager.roleExists( templateName ) )
|
||||
boolean roleExists = false;
|
||||
|
||||
try
|
||||
{
|
||||
roleExists = rbacManager.roleExists( templateName );
|
||||
}
|
||||
catch ( RbacManagerException e )
|
||||
{
|
||||
throw new RoleManagerException( e.getMessage(), e );
|
||||
}
|
||||
|
||||
if ( !roleExists )
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -344,7 +355,7 @@ public class DefaultRoleTemplateProcessor
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings( "unchecked" )
|
||||
@SuppressWarnings("unchecked")
|
||||
private List<Permission> processPermissions( RedbackRoleModel model, ModelTemplate template, String resource )
|
||||
throws RoleManagerException
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue