Skip to content

Fix copilotAndAbove permission to check that users is a member of the project #336

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from Jul 9, 2019
Merged

Conversation

ghost
Copy link

@ghost ghost commented Jul 6, 2019

No description provided.

Copy link
Contributor

@maxceem maxceem left a comment

Choose a reason for hiding this comment

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

@tc-mfikria

The logic of the method looks not fully correct. Let me provide you more details about the user roles.

Users may have two types of roles: Topcoder role and Project role.

  • Topcoder role is any role user has as Topcoder account and they listed here.
  • Project role is the role user has as a project member. So this type of role user has only when he is a member of some project. The list of possible Project roles is here. Theoretically, the same user may have different Project roles in different projects. So in theory Topcoder role and Project role don't have direct matching, though in practice we usually let users to have some Project roles only with some Topcoder roles.

How to check:

  • To check Topcoder role we use method util.hasRole as you did.

  • To check Project role we have to check what is member role in the member list inside role property. See example code
    image

    Also, see the example members list:

    image

Please, let me know if this description helps, or you have any questions.

@mfikria
Copy link
Contributor

mfikria commented Jul 8, 2019

@maxceem ok, got it. I've updated the logic. Thanks!

Copy link
Contributor

@maxceem maxceem left a comment

Choose a reason for hiding this comment

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

Thanks, @tc-mfikria works good.

@maxceem maxceem merged commit 8df56f6 into topcoder-platform:cf18 Jul 9, 2019
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.

2 participants