Allura/allura/model/auth.py
def my_projects_by_role_name(self, role_name):
        """
        Return  only projects for which user has
        that role.
        """
        if self.is_anonymous():
            return
        reaching_role_ids = list(
            g.credentials.user_roles(user_id=self._id).reaching_ids_set)
        reaching_roles = ProjectRole.query.find(
            {'_id': {'$in': reaching_role_ids}, 'name': role_name})
        projects = [r['project_id'] for r in reaching_roles]
        from .project import Project

        return Project.query.find({'_id': {'$in': projects}, 'deleted': False})

        Return  only projects for which user has
        that role.
        
Return  only projects for which user has
that role.
Return only projects for which user has that role .
def my_projects_by_role_name(self, role_name):
        if self.is_anonymous():
            return
        reaching_role_ids = list(
            g.credentials.user_roles(user_id=self._id).reaching_ids_set)
        reaching_roles = ProjectRole.query.find(
            {'_id': {'$in': reaching_role_ids}, 'name': role_name})
        projects = [r['project_id'] for r in reaching_roles]
        from .project import Project
        return Project.query.find({'_id': {'$in': projects}, 'deleted': False})
def my_projects_by_role_name ( self , role_name ) : if self . is_anonymous ( ) : return reaching_role_ids = list ( g . credentials . user_roles ( user_id = self . _id ) . reaching_ids_set ) reaching_roles = ProjectRole . query . find ( { '_id' : { '$in' : reaching_role_ids } , 'name' : role_name } ) projects = [ r [ 'project_id' ] for r in reaching_roles ] from . project import Project return Project . query . find ( { '_id' : { '$in' : projects } , 'deleted' : False } )
Return  only projects for which user has
that role.
Return only projects for which user has that role .
"""
        Return  only projects for which user has
        that role.
        """
self
role_name