outposts/ldap: Support hard coded uidNumber and gidNumber. (#1582)
				
					
				
			This commit is contained in:
		| @ -122,10 +122,22 @@ func (pi *ProviderInstance) GetVirtualGroupDN(group string) string { | |||||||
| } | } | ||||||
|  |  | ||||||
| func (pi *ProviderInstance) GetUidNumber(user api.User) string { | func (pi *ProviderInstance) GetUidNumber(user api.User) string { | ||||||
|  | 	uidNumber, ok := user.GetAttributes()["uidNumber"].(string) | ||||||
|  |  | ||||||
|  | 	if ok { | ||||||
|  | 		return uidNumber | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	return strconv.FormatInt(int64(pi.uidStartNumber+user.Pk), 10) | 	return strconv.FormatInt(int64(pi.uidStartNumber+user.Pk), 10) | ||||||
| } | } | ||||||
|  |  | ||||||
| func (pi *ProviderInstance) GetGidNumber(group api.Group) string { | func (pi *ProviderInstance) GetGidNumber(group api.Group) string { | ||||||
|  | 	gidNumber, ok := group.GetAttributes()["gidNumber"].(string) | ||||||
|  |  | ||||||
|  | 	if ok { | ||||||
|  | 		return gidNumber | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	return strconv.FormatInt(int64(pi.gidStartNumber+pi.GetRIDForGroup(group.Pk)), 10) | 	return strconv.FormatInt(int64(pi.gidStartNumber+pi.GetRIDForGroup(group.Pk)), 10) | ||||||
| } | } | ||||||
|  |  | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Ilya Kogan
					Ilya Kogan