@ SuppressWarnings ( "unchecked" ) public Map < Instance , Boolean > checkAccess ( final Collection < Instance > _instances , final AccessType _accessType ) throws EFapsException { Map < Instance , Boolean > ret = new HashMap <> ( ) ; if ( _instances != null && ! _instances . isEmpty ( ) && _instances . size ( ) == 1 ) { final Instance instance = _instances . iterator ( ) . next ( ) ; ret . put ( instance , hasAccess ( instance , _accessType ) ) ; } else { final List < EventDefinition > events = super . getEvents ( EventType . ACCESSCHECK ) ; if ( events != null ) { final Parameter parameter = new Parameter ( ) ; parameter . put ( ParameterValues . OTHERS , _instances ) ; parameter . put ( ParameterValues . ACCESSTYPE , _accessType ) ; parameter . put ( ParameterValues . CLASS , this ) ; for ( final EventDefinition event : events ) { final Return retrn = event . execute ( parameter ) ; ret = ( Map < Instance , Boolean > ) retrn . get ( ReturnValues . VALUES ) ; } } else { for ( final Instance instance : _instances ) { ret . put ( instance , true ) ; } } } return ret ; }
Method to check the access right for a list of instances .