mirror of
https://github.com/harness/drone.git
synced 2025-07-12 07:08:20 +00:00
[CODE-631]: use parent ref in space membership (#226)
This commit is contained in:
parent
bc5945f8ba
commit
914050c8a1
@ -98,7 +98,8 @@ func (c *Controller) Create(ctx context.Context, session *auth.Session, in *Crea
|
||||
}
|
||||
|
||||
// add space membership to top level space only (as the user doesn't have inhereted permissions alraedy)
|
||||
if in.ParentID == 0 {
|
||||
parentRefAsID, err := strconv.ParseInt(in.ParentRef, 10, 64)
|
||||
if (err == nil && parentRefAsID == 0) || (len(strings.TrimSpace(in.ParentRef)) == 0) {
|
||||
membership := &types.Membership{
|
||||
SpaceID: space.ID,
|
||||
PrincipalID: session.Principal.ID,
|
||||
|
Loading…
x
Reference in New Issue
Block a user