예제 #1
0
// HasOrganization checks if the organization is already registered in autograder.
func HasOrganization(name string) bool {
	if _, ok := InMemoryOrgs[name]; ok {
		return true
	}

	return database.Has(OrganizationBucketName, name)
}
예제 #2
0
파일: tokens.go 프로젝트: tokams/autograder
// HasTokenInStore checks if the token is in storage.
func (t *Token) HasTokenInStore() bool {
	hash := sha256.Sum256([]byte(t.accessToken))
	return database.Has(TokenBucketName, fmt.Sprintf("%x", hash))
}
예제 #3
0
// HasMember checks if the user is stored in the system.
func HasMember(username string) bool {
	return database.Has(MemberBucketName, username)
}
예제 #4
0
// HasGroup will check if the group is in storage.
func HasGroup(groupid int) bool {
	return database.Has(GroupsBucketName, strconv.Itoa(groupid))
}