68
def is_authorized(self, context):
68
def is_authorized(self, context, readonly=False):
69
# NOTE(devcamcar): Public images can be read by anyone,
70
# but only modified by admin or owner.
70
return self.metadata['isPublic'] or context.user.is_admin() or self.metadata['imageOwnerId'] == context.project.id
72
return (self.metadata['isPublic'] and readonly) or \
73
context.user.is_admin() or \
74
self.metadata['imageOwnerId'] == context.project.id