Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(api): get projects from provider with username#4916

Merged
richardlt merged 2 commits intomasterfrom
fix/api-get-projects
Jan 24, 2020
Merged

fix(api): get projects from provider with username#4916
richardlt merged 2 commits intomasterfrom
fix/api-get-projects

Conversation

@fsamin
Copy link
Member

@fsamin fsamin commented Jan 23, 2020

  1. Description
  2. Related issues
  3. About tests
  4. Mentions

@ovh/cds


pKeys := projects.Keys()
perms, err := permission.LoadProjectMaxLevelPermission(ctx, api.mustDB(), pKeys, getAPIConsumer(ctx).GetGroupIDs())
perms, err := permission.LoadProjectMaxLevelPermission(ctx, api.mustDB(), pKeys, groupIDs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this code is useful only if withPermission, also maintainer an admin can have no permission on project based on groups but we should add read permission for maintainer and all permissions for admin.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We always need permission. BWT i fixed it for admin, and maintainer permissions

}

pKeys := projects.Keys()
perms, err := permission.LoadProjectMaxLevelPermission(ctx, api.mustDB(), pKeys, getAPIConsumer(ctx).GetGroupIDs())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comments

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@fsamin fsamin requested a review from richardlt January 24, 2020 10:31
@richardlt richardlt merged commit c08ddfe into master Jan 24, 2020
@fsamin fsamin deleted the fix/api-get-projects branch January 31, 2020 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants