mirror of
https://github.com/corda/corda.git
synced 2025-06-21 08:40:03 +00:00
[ENT-850]: RPC function to kill a flow (#215)
* Tentative API and implementation. * Tests completed. API update needed. * Updated api-current.txt. Some previous changes hadn't been reflected and now they are. * Improved the tests. * Some code review changes. * Merge branch 'master' into features/ENT-850 # Conflicts: # .ci/api-current.txt * Code review changes. * Code review changes.
This commit is contained in:
committed by
GitHub
parent
d9574338bc
commit
0711ad34e3
@ -1,9 +1,6 @@
|
||||
package net.corda.client.rpc
|
||||
|
||||
import net.corda.core.flows.FlowLogic
|
||||
import net.corda.core.messaging.CordaRPCOps
|
||||
import net.corda.core.messaging.RPCOps
|
||||
import net.corda.node.services.Permissions
|
||||
import net.corda.node.services.messaging.rpcContext
|
||||
import net.corda.nodeapi.internal.config.User
|
||||
import net.corda.testing.node.internal.RPCDriverDSL
|
||||
@ -122,6 +119,17 @@ class RPCPermissionsTests : AbstractRPCTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `killing flows requires permission`() {
|
||||
|
||||
rpcDriver {
|
||||
val proxy = testProxyFor(userOf("joe", emptySet()))
|
||||
assertNotAllowed {
|
||||
proxy.validatePermission("killFlow")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun assertNotAllowed(action: () -> Unit) {
|
||||
|
||||
assertFailsWith(PermissionException::class, "User should not be allowed to perform this action.", action)
|
||||
|
Reference in New Issue
Block a user