(cls, q, user=None)
return q
Modifies the sqlalchemy query `q` to only show channels accessible
        to `user`. If `user` is ``None``, only shows public channels in
        public projects.
Modifies the sqlalchemy query `q` to only show channels accessible
        to `user`. If `user` is ``None``, only shows public channels in
        public projects.
Modifies the sqlalchemy query q to only show channels accessible to user . If user is None only shows public channels in public projects .
def visible(cls, q, user=None):
        """
        Modifies the sqlalchemy query `q` to only show channels accessible
        to `user`. If `user` is ``None``, only shows public channels in
        public projects.
        """
        from notifico.models import Project

        if user and user.in_group('admin'):
            # We don't do any filtering for admins,
            # who should have full visibility.
            pass
        else:
            q = q.join(Channel.project).filter(
                Project.public == True,
                Channel.public == True
            )

        return q
def visible ( cls , q , user = None ) : from notifico . models import Project if user and user . in_group ( 'admin' ) : # We don't do any filtering for admins, # who should have full visibility. pass else : q = q . join ( Channel . project ) . filter ( Project . public == True , Channel . public == True ) return q