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