|
a/Allura/allura/model/project.py |
|
b/Allura/allura/model/project.py |
|
... |
|
... |
306 |
|
306 |
|
307 |
@property
|
307 |
@property
|
308 |
def roles(self):
|
308 |
def roles(self):
|
309 |
from . import auth
|
309 |
from . import auth
|
310 |
with h.push_config(c, project=self):
|
310 |
with h.push_config(c, project=self):
|
|
|
311 |
root_roles = [
|
311 |
root_roles = auth.ProjectRole.query.find(dict(
|
312 |
role for role in auth.ProjectRole.query.find(dict(
|
312 |
project_id=self.root_project._id,
|
313 |
project_id=self.root_project._id))
|
313 |
name={'$in':['Admin','Developer']})).all()
|
314 |
if role.name ]
|
314 |
if not root_roles:
|
|
|
315 |
root_roles = auth.ProjectRole.query.find(dict(
|
|
|
316 |
project_id={'$exists': False },
|
|
|
317 |
name={'$in':['Admin','Developer']})).all()
|
|
|
318 |
roles = list(auth.ProjectRole.roles_that_reach(*root_roles))
|
315 |
roles = list(auth.ProjectRole.roles_that_reach(*root_roles))
|
319 |
return sorted(roles, key=lambda r:r.display())
|
316 |
return sorted(roles, key=lambda r:r.display())
|
320 |
|
317 |
|
321 |
@property
|
318 |
@property
|
322 |
def accolades(self):
|
319 |
def accolades(self):
|