Allow non admin user to create and see tickets
Change-Id: Iffc7ae2e60b6752a7c73176e8cbb283d10b78f6f
This commit is contained in:
parent
836c035096
commit
4cf1e3ee11
@ -2,12 +2,14 @@
|
|||||||
# of appearance. Changing the order has an impact on the overall integration
|
# of appearance. Changing the order has an impact on the overall integration
|
||||||
# process, which may cause wedges in the gate later.
|
# process, which may cause wedges in the gate later.
|
||||||
|
|
||||||
pbr>=0.6,!=0.7,<1.0
|
pbr<2.0,>=1.3
|
||||||
Babel>=1.3
|
Babel>=1.3
|
||||||
python-redmine
|
python-redmine
|
||||||
paste
|
paste
|
||||||
pecan>=0.4.5
|
pecan>=0.8.0
|
||||||
oslo.messaging>=1.3.0,<=1.4.1
|
oslo.messaging>=1.3.0,<1.5
|
||||||
oslo.config>=1.4.0 # Apache-2.0
|
oslo.config>=1.11.0,<=1.15.0 # Apache-2.0
|
||||||
python-keystoneclient>=0.4.2,<0.12
|
oslo.utils<2.0.0
|
||||||
WSME>=0.6
|
oslo.serialization<1.7.0
|
||||||
|
python-keystoneclient>=1.6.0
|
||||||
|
WSME>=0.7
|
||||||
|
11
setup.py
Executable file → Normal file
11
setup.py
Executable file → Normal file
@ -1,4 +1,3 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
|
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -17,6 +16,14 @@
|
|||||||
# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
|
# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
|
||||||
import setuptools
|
import setuptools
|
||||||
|
|
||||||
|
# In python < 2.7.4, a lazy loading of package `pbr` will break
|
||||||
|
# setuptools if some other modules registered functions in `atexit`.
|
||||||
|
# solution from: http://bugs.python.org/issue15881#msg170215
|
||||||
|
try:
|
||||||
|
import multiprocessing # noqa
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
setup_requires=['pbr'],
|
setup_requires=['pbr>=1.3'],
|
||||||
pbr=True)
|
pbr=True)
|
||||||
|
@ -24,4 +24,5 @@ app = {
|
|||||||
'debug': True,
|
'debug': True,
|
||||||
'enable_acl': False,
|
'enable_acl': False,
|
||||||
'acl_public_routes': ['/', '/v1'],
|
'acl_public_routes': ['/', '/v1'],
|
||||||
|
'member_routes': ['/v1/ticket', ]
|
||||||
}
|
}
|
||||||
|
@ -88,8 +88,16 @@ class AdminAuthHook(hooks.PecanHook):
|
|||||||
rejects the request if the api is not public.
|
rejects the request if the api is not public.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
def is_path_in_routes(self, path):
|
||||||
|
for p in self.member_routes:
|
||||||
|
if path.startswith(p):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def before(self, state):
|
def before(self, state):
|
||||||
ctx = state.request.context
|
ctx = state.request.context
|
||||||
|
|
||||||
if not ctx.is_admin and not ctx.is_public_api:
|
if not ctx.is_admin and not ctx.is_public_api and \
|
||||||
raise exc.HTTPForbidden()
|
not self.is_path_in_routes(state.request.path):
|
||||||
|
raise exc.HTTPForbidden()
|
||||||
|
@ -68,7 +68,7 @@ class TrackingBase(object):
|
|||||||
|
|
||||||
def _has_sticks_role(self, user_id, role_id, project_id):
|
def _has_sticks_role(self, user_id, role_id, project_id):
|
||||||
"""
|
"""
|
||||||
Evaluates whether this user has ikare role. Returns
|
Evaluates whether this user has sticks role. Returns
|
||||||
``True`` or ``False``.
|
``True`` or ``False``.
|
||||||
"""
|
"""
|
||||||
if self.kc is None:
|
if self.kc is None:
|
||||||
|
@ -2,21 +2,20 @@
|
|||||||
# of appearance. Changing the order has an impact on the overall integration
|
# of appearance. Changing the order has an impact on the overall integration
|
||||||
# process, which may cause wedges in the gate later.
|
# process, which may cause wedges in the gate later.
|
||||||
|
|
||||||
hacking>=0.9.2,<0.10
|
hacking<0.10,>=0.9.2
|
||||||
# mock object framework
|
# mock object framework
|
||||||
mock>=1.0
|
mock>=1.2
|
||||||
coverage>=3.6
|
coverage>=3.6
|
||||||
discover
|
discover
|
||||||
# fixture stubbing
|
# fixture stubbing
|
||||||
fixtures>=0.3.14
|
fixtures>=1.3.1
|
||||||
oslotest>=1.1.0 # Apache-2.0
|
oslotest>=1.10.0 # Apache-2.0
|
||||||
python-subunit
|
python-subunit>=0.0.18
|
||||||
junitxml
|
|
||||||
nose
|
nose
|
||||||
nose-exclude
|
nose-exclude
|
||||||
nosexcover
|
nosexcover
|
||||||
# Doc requirements
|
# Doc requirements
|
||||||
sphinx>=1.1.2,!=1.2.0,<1.3
|
sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2
|
||||||
oslosphinx
|
oslosphinx>=2.5.0 # Apache-2.0
|
||||||
sphinxcontrib-httpdomain
|
sphinxcontrib-httpdomain
|
||||||
sphinxcontrib-pecanwsme>=0.8
|
sphinxcontrib-pecanwsme>=0.8
|
||||||
|
Loading…
x
Reference in New Issue
Block a user