You should't use "Rest" that way, try "PathElement" instead:
path(PathElement / "permission") { id =>
...
}
If it's an Int use IntNumber, but Rest is if you want to match the "rest" of the url to the end... so it doesn't make sense the way you used, it should be put at the end.