| 1 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 2 |
# not use this file except in compliance with the License. You may obtain |
| 3 |
# a copy of the License at |
| 4 |
# |
| 5 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 6 |
# |
| 7 |
# Unless required by applicable law or agreed to in writing, software |
| 8 |
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 9 |
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 10 |
# License for the specific language governing permissions and limitations |
| 11 |
# under the License. |
| 12 |
|
| 13 |
from oslo_policy import policy |
| 14 |
|
| 15 |
from neutron.conf.policies import base |
| 16 |
|
| 17 |
|
| 18 |
COLLECTION_PATH = '/taas/tap_mirrors' |
| 19 |
RESOURCE_PATH = '/taas/tap_mirrors/{id}' |
| 20 |
|
| 21 |
rules = [ |
| 22 |
policy.DocumentedRuleDefault( |
| 23 |
name='create_tap_mirror', |
| 24 |
check_str=base.ADMIN_OR_PROJECT_MEMBER, |
| 25 |
scope_types=['project'], |
| 26 |
description='Create a Tap Mirror', |
| 27 |
operations=[ |
| 28 |
{ |
| 29 |
'method': 'POST', |
| 30 |
'path': COLLECTION_PATH |
| 31 |
} |
| 32 |
], |
| 33 |
), |
| 34 |
policy.DocumentedRuleDefault( |
| 35 |
name='update_tap_mirror', |
| 36 |
check_str=base.ADMIN_OR_PROJECT_MEMBER, |
| 37 |
scope_types=['project'], |
| 38 |
description='Update a Tap Mirror', |
| 39 |
operations=[ |
| 40 |
{ |
| 41 |
'method': 'PUT', |
| 42 |
'path': RESOURCE_PATH |
| 43 |
} |
| 44 |
], |
| 45 |
), |
| 46 |
policy.DocumentedRuleDefault( |
| 47 |
name='get_tap_mirror', |
| 48 |
check_str=base.ADMIN_OR_PROJECT_READER, |
| 49 |
scope_types=['project'], |
| 50 |
description='Show a Tap Mirror', |
| 51 |
operations=[ |
| 52 |
{ |
| 53 |
'method': 'GET', |
| 54 |
'path': COLLECTION_PATH |
| 55 |
}, |
| 56 |
{ |
| 57 |
'method': 'GET', |
| 58 |
'path': RESOURCE_PATH |
| 59 |
}, |
| 60 |
] |
| 61 |
), |
| 62 |
policy.DocumentedRuleDefault( |
| 63 |
name='delete_tap_mirror', |
| 64 |
check_str=base.ADMIN_OR_PROJECT_MEMBER, |
| 65 |
scope_types=['project'], |
| 66 |
description='Delete a Tap Mirror', |
| 67 |
operations=[ |
| 68 |
{ |
| 69 |
'method': 'DELETE', |
| 70 |
'path': RESOURCE_PATH, |
| 71 |
} |
| 72 |
] |
| 73 |
), |
| 74 |
] |
| 75 |
|
| 76 |
|
| 77 |
def list_rules(): |
| 78 |
return rules |