Add missing policy check for queue stats and share
Zaqar is missing the policy check for queue stats and share API. This patch adds them and update the sample policy file. Closes-Bug: #1640313 Change-Id: I79e84fb02588148c5df88e4115e17e4ecd9369a4
This commit is contained in:
parent
e306d72268
commit
5edc11d8f3
@ -9,6 +9,7 @@
|
||||
"queues:delete": "",
|
||||
"queues:update": "",
|
||||
"queues:stats": "",
|
||||
"queues:share": "",
|
||||
|
||||
"messages:get_all": "",
|
||||
"messages:create": "",
|
||||
|
@ -9,6 +9,7 @@
|
||||
"queues:delete": "",
|
||||
"queues:update": "",
|
||||
"queues:stats": "",
|
||||
"queues:share": "",
|
||||
|
||||
"messages:get_all": "",
|
||||
"messages:create": "",
|
||||
|
@ -18,6 +18,7 @@ import six
|
||||
|
||||
from zaqar.i18n import _
|
||||
from zaqar.storage import errors as storage_errors
|
||||
from zaqar.transport import acl
|
||||
from zaqar.transport import utils
|
||||
from zaqar.transport.wsgi import errors as wsgi_errors
|
||||
|
||||
@ -32,6 +33,7 @@ class Resource(object):
|
||||
def __init__(self, queue_controller):
|
||||
self._queue_ctrl = queue_controller
|
||||
|
||||
@acl.enforce("queues:stats")
|
||||
def on_get(self, req, resp, project_id, queue_name):
|
||||
try:
|
||||
resp_dict = self._queue_ctrl.stats(queue_name,
|
||||
|
@ -19,6 +19,7 @@ import six
|
||||
|
||||
from zaqar.common import urls
|
||||
from zaqar.i18n import _LE
|
||||
from zaqar.transport import acl
|
||||
from zaqar.transport import utils
|
||||
from zaqar.transport.wsgi import errors as wsgi_errors
|
||||
from zaqar.transport.wsgi import utils as wsgi_utils
|
||||
@ -38,6 +39,7 @@ class Resource(object):
|
||||
self._driver = driver
|
||||
self._conf = driver._conf
|
||||
|
||||
@acl.enforce("queues:share")
|
||||
def on_post(self, req, resp, project_id, queue_name):
|
||||
LOG.debug(u'Pre-Signed URL Creation for queue: %(queue)s, '
|
||||
u'project: %(project)s',
|
||||
|
Loading…
x
Reference in New Issue
Block a user