public void onRemoveChildResource ( final ModelNode address , final ModelNode selection ) { final ModelNode fqAddress = AddressUtils . toFqAddress ( address , selection . asString ( ) ) ; _loadMetaData ( fqAddress , new ResourceData ( true ) , new Outcome < ResourceData > ( ) { @ Override public void onFailure ( ResourceData context ) { Console . error ( "Failed to load metadata for " + address . asString ( ) ) ; } @ Override public void onSuccess ( ResourceData context ) { String resourceAddress = AddressUtils . asKey ( fqAddress , true ) ; if ( context . securityContext . getWritePrivilege ( resourceAddress ) . isGranted ( ) ) { _onRemoveChildResource ( address , selection ) ; } else { Feedback . alert ( Console . CONSTANTS . unauthorized ( ) , Console . CONSTANTS . unauthorizedRemove ( ) ) ; } } } ) ; }
Checks permissions and removes a child resource