func (u *UserInfoLDAPSource) IsgroupmemberorNot(groupname string, username string) (bool, string, error) {

	AllUsersinGroup, GroupmanagedbyValue, err := u.GetusersofaGroup(groupname)
	if err != nil {
		log.Println(err)
		return false, GroupmanagedbyValue, err
	}
	for _, entry := range AllUsersinGroup {
		if entry == username {
			return true, GroupmanagedbyValue, nil
		}
	}
	return false, GroupmanagedbyValue, nil
}
//if user is already a member of group or not
if user is already a member of group or not
// if user is already a member of group or not
func (u *UserInfoLDAPSource) IsgroupmemberorNot(groupname string, username string) (bool, string, error) {
	AllUsersinGroup, GroupmanagedbyValue, err := u.GetusersofaGroup(groupname)
	if err != nil {
		log.Println(err)
		return false, GroupmanagedbyValue, err
	}
	for _, entry := range AllUsersinGroup {
		if entry == username {
			return true, GroupmanagedbyValue, nil
		}
	}
	return false, GroupmanagedbyValue, nil
}
func ( u * UserInfoLDAPSource ) IsgroupmemberorNot ( groupname string , username string ) ( bool , string , error ) { AllUsersinGroup , GroupmanagedbyValue , err := u . GetusersofaGroup ( groupname ) if err != nil { log . Println ( err ) return false , GroupmanagedbyValue , err } for _ , entry := range AllUsersinGroup { if entry == username { return true , GroupmanagedbyValue , nil } } return false , GroupmanagedbyValue , nil }
if user is already a member of group or not
if user is already a member of group or not