blob: 0a996cb59671c893176f7b2eb60053b404667969 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.container.jdisc;
/**
* Default ACL mapping
* @author mortent
*/
public class DefaultAclMapping implements AclMapping {
@Override
public Action get(RequestView requestMeta) {
switch (requestMeta.method()) {
case GET:
case HEAD:
case OPTIONS:
return Action.read;
case POST:
return Action.create;
case DELETE:
return Action.delete;
case PUT:
case PATCH:
case CONNECT:
case TRACE:
return Action.update;
default:
throw new IllegalArgumentException("Illegal request method: " + requestMeta.method());
}
}
}
|