fix(bolt): grand first user org admin privileges during onboarding

pull/10616/head
Michael Desa 2019-01-09 10:35:50 -05:00
parent 6f0d55d19e
commit ead4a0a170
1 changed files with 5 additions and 1 deletions

View File

@ -117,11 +117,15 @@ func (c *Client) Generate(ctx context.Context, req *platform.OnboardingRequest)
if err = c.CreateBucket(ctx, bucket); err != nil {
return nil, err
}
perms := platform.OperPermissions()
perms = append(perms, platform.OrgAdminPermissions(o.ID)...)
auth := &platform.Authorization{
UserID: u.ID,
Description: fmt.Sprintf("%s's Token", u.Name),
OrgID: o.ID,
Permissions: platform.OperPermissions(),
Permissions: perms,
}
if err = c.CreateAuthorization(ctx, auth); err != nil {
return nil, err