Example #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)
}
Example #2
0
// 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))
}
Example #3
0
// HasMember checks if the user is stored in the system.
func HasMember(username string) bool {
	return database.Has(MemberBucketName, username)
}
Example #4
0
// HasGroup will check if the group is in storage.
func HasGroup(groupid int) bool {
	return database.Has(GroupsBucketName, strconv.Itoa(groupid))
}