@@ -225,7 +225,8 @@ def delete_locations(self):
225
225
self ._enforce ('delete_image_location' )
226
226
# TODO(danms): Remove this legacy fallback when secure RBAC
227
227
# replaces the legacy policy.
228
- if not CONF .enforce_secure_rbac :
228
+ if not (CONF .oslo_policy .enforce_new_defaults or
229
+ CONF .oslo_policy .enforce_scope ):
229
230
check_is_image_mutable (self ._context , self ._image )
230
231
231
232
def get_image_location (self ):
@@ -247,7 +248,8 @@ def add_image(self):
247
248
raise
248
249
if 'visibility' in self ._target :
249
250
self ._enforce_visibility (self ._target ['visibility' ])
250
- if not CONF .enforce_secure_rbac :
251
+ if not (CONF .oslo_policy .enforce_new_defaults or
252
+ CONF .oslo_policy .enforce_scope ):
251
253
check_admin_or_same_owner (self ._context , self ._target )
252
254
253
255
def get_image (self ):
@@ -260,14 +262,16 @@ def delete_image(self):
260
262
self ._enforce ('delete_image' )
261
263
# TODO(danms): Remove this legacy fallback when secure RBAC
262
264
# replaces the legacy policy.
263
- if not CONF .enforce_secure_rbac :
265
+ if not (CONF .oslo_policy .enforce_new_defaults or
266
+ CONF .oslo_policy .enforce_scope ):
264
267
check_is_image_mutable (self ._context , self ._image )
265
268
266
269
def upload_image (self ):
267
270
self ._enforce ('upload_image' )
268
271
# TODO(danms): Remove this legacy fallback when secure RBAC
269
272
# replaces the legacy policy.
270
- if not CONF .enforce_secure_rbac :
273
+ if not (CONF .oslo_policy .enforce_new_defaults or
274
+ CONF .oslo_policy .enforce_scope ):
271
275
check_is_image_mutable (self ._context , self ._image )
272
276
273
277
def download_image (self ):
@@ -277,21 +281,24 @@ def modify_image(self):
277
281
self ._enforce ('modify_image' )
278
282
# TODO(danms): Remove this legacy fallback when secure RBAC
279
283
# replaces the legacy policy.
280
- if not CONF .enforce_secure_rbac :
284
+ if not (CONF .oslo_policy .enforce_new_defaults or
285
+ CONF .oslo_policy .enforce_scope ):
281
286
check_is_image_mutable (self ._context , self ._image )
282
287
283
288
def deactivate_image (self ):
284
289
self ._enforce ('deactivate' )
285
290
# TODO(danms): Remove this legacy fallback when secure RBAC
286
291
# replaces the legacy policy.
287
- if not CONF .enforce_secure_rbac :
292
+ if not (CONF .oslo_policy .enforce_new_defaults or
293
+ CONF .oslo_policy .enforce_scope ):
288
294
check_is_image_mutable (self ._context , self ._image )
289
295
290
296
def reactivate_image (self ):
291
297
self ._enforce ('reactivate' )
292
298
# TODO(danms): Remove this legacy fallback when secure RBAC
293
299
# replaces the legacy policy.
294
- if not CONF .enforce_secure_rbac :
300
+ if not (CONF .oslo_policy .enforce_new_defaults or
301
+ CONF .oslo_policy .enforce_scope ):
295
302
check_is_image_mutable (self ._context , self ._image )
296
303
297
304
def copy_image (self ):
0 commit comments