Пример #1
0
def validate_owner(request, repo_id):
    """
    Check whether user in the request owns the repo.

    """
    ret = is_repo_owner(request.user.username, repo_id)

    return True if ret else False
Пример #2
0
def validate_owner(request, repo_id):
    """
    Check whether user in the request owns the repo.

    """
    ret = is_repo_owner(request.user.username, repo_id)

    return True if ret else False
Пример #3
0
    def has_permission(self, request, view, obj=None):
        repo_id = view.kwargs.get('repo_id', '')
        user = request.user.username if request.user else ''

        return True if is_repo_owner(user, repo_id) else False
Пример #4
0
    def has_permission(self, request, view, obj=None):
        repo_id = view.kwargs.get('repo_id', '')
        user = request.user.username if request.user else ''

        return True if is_repo_owner(user, repo_id) else False
Пример #5
0
 def is_repo_owner(self, username, repo_id):
     if self.request.user.org:
         return is_org_repo_owner(self.request.user.org['org_id'],
                                  repo_id, username)
     else:
         return is_repo_owner(username, repo_id)
Пример #6
0
 def is_repo_owner(self, username, repo_id):
     if self.request.user.org:
         return is_org_repo_owner(self.request.user.org['org_id'], repo_id,
                                  username)
     else:
         return is_repo_owner(username, repo_id)