// hasBuiltinRole checks the type of the role set returned and the name.
// Returns true if role set is builtin and the name matches.
977679
func (a *AuthWithRoles) hasBuiltinRole(name string) bool {
	return hasBuiltinRole(a.checker, name)
}
1124671
func (r Account) HasAttribute(attributeType *string) (resp bool, err error) {
	params := []interface{}{
		attributeType,
	}
	err = r.Session.DoRequest("SoftLayer_Account", "hasAttribute", params, &r.Options, &resp)
	return
}
103940
func WithInitiallySuppressedRoles(r []string) Option {
	return func(c *Config) Option {
		old := c.initSuppressRoles
		c.initSuppressRoles = r
		return WithInitiallySuppressedRoles(old)
	}
}
243931
func checkBuildReadiness(obj runtime.Object) (bool, bool, error) {
	b, ok := obj.(*buildv1.Build)
	if !ok {
		return false, false, fmt.Errorf("object %T is not v1.Build", obj)
	}

	ready := buildutil.IsTerminalPhase(b.Status.Phase) &&
		b.Status.Phase == buildv1.BuildPhaseComplete

	failed := buildutil.IsTerminalPhase(b.Status.Phase) &&
		b.Status.Phase != buildv1.BuildPhaseComplete

	return ready, failed, nil
}
1049938
func (e *SyncedEnforcer) HasRoleForUser(name string, role string) bool {
	e.m.Lock()
	defer e.m.Unlock()
	return e.Enforcer.HasRoleForUser(name, role)
}
581876
func RoleByName(s string) (Role, bool) {
	for i, v := range roleNames {
		if v == strings.ToUpper(s) {
			return Role(i), true
		}
	}
	return NumRoles, false
}
1198858
func (set RoleSet) HasRole(role string) bool {
	for _, r := range set {
		if r.GetName() == role {
			return true
		}
	}
	return false
}
486832
func (rb *repoBuilder) IsLoaded(roleName data.RoleName) bool {
	switch roleName {
	case data.CanonicalRootRole:
		return rb.repo.Root != nil
	case data.CanonicalSnapshotRole:
		return rb.repo.Snapshot != nil
	case data.CanonicalTimestampRole:
		return rb.repo.Timestamp != nil
	default:
		return rb.repo.Targets[roleName] != nil
	}
}
369482
func (m *GormIdentityRoleRepository) FindIdentityRolesByResourceAndRoleName(ctx context.Context, resourceID string, roleName string, includeParenResources bool) ([]IdentityRole, error) {
	if includeParenResources {
		return m.findIdentityRolesByResourceAndRoleNameWithParents(ctx, resourceID, roleName)
	}
	return m.findIdentityRolesByResourceAndRoleName(ctx, resourceID, roleName)
}
1279149
func (v *Value) HasContainer() bool {
	return v.Container != nil && *v.Container != "" && *v.Container != instance.NONE
}
178969
func (s *IPRoleList) GetAllRoles() ([]IPRole, error) {
	roles := s.Roles
	t := s

	for t.HasNextPage() {
		var err error
		t, err = t.NextPage()
		if err != nil {
			return nil, err
		}
		roles = append(roles, t.Roles...)
	}
	return roles, nil
}
809878
func NewRoleList(roles []string) []RoleName {
	var roleNames []RoleName
	for _, role := range roles {
		roleNames = append(roleNames, RoleName(role))
	}
	return roleNames
}
1314416
func RoleCheck(c Context, key, match string) bool {
	for _, r := range c.Roles {
		if r == match {
			return true
		}
	}
	return false
}
1051451
func (u *UserV2) AddRole(name string) {
	for _, r := range u.Spec.Roles {
		if r == name {
			return
		}
	}
	u.Spec.Roles = append(u.Spec.Roles, name)
}
799287
func isExportedOrBuiltin(t reflect.Type) bool {
	for t.Kind() == reflect.Ptr {
		t = t.Elem()
	}
	// PkgPath will be non-empty even for an exported type,
	// so we need to check the type name as well.
	return isExported(t.Name()) || t.PkgPath() == ""
}
919035
func hasOrganizationAdmin(roles *roles, organizatioName string) bool {
	for _, role := range roles.Role {
		if role.Name == "orgadmin" && role.Organization == organizatioName {
			return true
		}
	}

	return false
}
1222202
func containsRole(v kops.InstanceGroupRole, list []kops.InstanceGroupRole) bool {
	for _, x := range list {
		if v == x {
			return true
		}
	}

	return false
}