# Path: repocribro/database.py



import flask_sqlalchemy
import sqlalchemy
import flask_login
import datetime
import fnmatch
import re
        import uuid
        import hashlib
from .database import db
        """
        return [self.rolename]

    def owns_repo(self, repo):
        """Check if user owns the repository

        :param repo: Repository which shoudl be tested
        :type repo: ``repocribro.models.Repository``
        :return: False, anonymous can not own repository
        :rtype: bool
        """
        return False

    def sees_repo(self, repo, has_secret=False):
        """Check if user is allowed to see the repo

        Anonymous can see only public repos

        :param repo: Repository which user want to see
        :type repo: ``repocribro.models.Repository``
        :param has_secret: If current user knows the secret URL
        :type has_secret: bool
        :return: If user can see repo
        :rtype: bool
        """
        visible = repo.is_public or (has_secret and repo.is_hidden)
        return visible


#: Many-to-many relationship between user accounts and roles

# Path: repocribro/database.py



# Path: repocribro/models.py
import flask_sqlalchemy
import sqlalchemy
import flask_login
import datetime
import fnmatch
import re
        import uuid
        import hashlib
from .database import db

        """
        return [self.rolename]

    def owns_repo(self, repo):
        """Check if user owns the repository

        :param repo: Repository which shoudl be tested
        :type repo: ``repocribro.models.Repository``
        :return: False, anonymous can not own repository
        :rtype: bool
        """
        return False

    def sees_repo(self, repo, has_secret=False):
        """Check if user is allowed to see the repo

        Anonymous can see only public repos

        :param repo: Repository which user want to see
        :type repo: ``repocribro.models.Repository``
        :param has_secret: If current user knows the secret URL
        :type has_secret: bool
        :return: If user can see repo
        :rtype: bool
        """
        visible = repo.is_public or (has_secret and repo.is_hidden)
        return visible


#: Many-to-many relationship between user accounts and roles

roles_users = db.Table(