private Instance<AuthorizationManager> authorizationManagers;
@PostConstruct
public void setup() {
AuthenticationManager _authenticationManager = null;
AuthorizationManager _authorizationManager = null;
if ( authenticationManagers.isUnsatisfied() ) {
final String authType = System.getProperty( "org.uberfire.io.auth", null );
final String domain = System.getProperty( SecurityConstants.AUTH_DOMAIN_KEY, null );
final String _mode = System.getProperty( ROLE_MODE_KEY, RolesMode.GROUP.toString() );
RolesMode mode;
try {
mode = RolesMode.valueOf( _mode );
} catch ( final Exception ignore ) {
mode = RolesMode.GROUP;
}
if ( authType == null || authType.toLowerCase().equals( "jaas" ) || authType.toLowerCase().equals( "container" ) ) {
_authenticationManager = new JAASAuthenticationManager( domain, mode );
} else if ( authType.toLowerCase().equals( "property" ) ) {
_authenticationManager = new PropertyAuthenticationManager( null );
} else {
_authenticationManager = loadClazz( authType, AuthenticationManager.class );
}
}
if ( authorizationManagers.isUnsatisfied() ) {
_authorizationManager = new FileSystemAuthorizationManager();
}
final AuthorizationManager authorizationManager = _authorizationManager;
final AuthenticationManager authenticationManager = _authenticationManager;
final org.uberfire.java.nio.security.AuthorizationManager ioAuthorizationManager = new org.uberfire.java.nio.security.AuthorizationManager() {
@Override
public boolean authorize( final FileSystem fs,
final Subject subject ) {
return authorizationManager.authorize( new FileSystemResourceAdaptor( fs ), ( (SubjectWrapper) subject ).getRealSubject() );
}
};
for ( final FileSystemProvider fileSystemProvider : FileSystemProviders.installedProviders() ) {
if ( fileSystemProvider instanceof SecurityAware ) {