Example #1
0
def check():
    """Check application access."""
    headers = flask.request.headers
    if not policy.check_is_admin(headers.get('X-Roles', "").split(","),
                                 headers.get('X-Tenant-Id'),
                                 headers.get('X-Tenant-Name')):
        return "Access denied", 401
Example #2
0
def get_limited_to_project(headers):
    """Return the tenant the request should be limited to."""
    if not policy.check_is_admin(headers.get('X-Roles', "").split(",")):
        return headers.get('X-Tenant-Id')
Example #3
0
def get_limited_to_project(headers):
    """Return the tenant the request should be limited to."""
    if not policy.check_is_admin(headers.get('X-Roles', "").split(",")):
        return headers.get('X-Tenant-Id')
Example #4
0
 def before(self, state):
     headers = state.request.headers
     if not policy.check_is_admin(headers.get("X-Roles", "").split(",")):
         raise exc.HTTPUnauthorized()
Example #5
0
 def before(self, state):
     headers = state.request.headers
     if not policy.check_is_admin(headers.get('X-Roles', "").split(",")):
         raise exc.HTTPUnauthorized()