Skip to content

[$60] allow normal topcoder members to create jobs #23

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

Closed
nkumar-topcoder opened this issue Dec 2, 2020 · 14 comments
Closed

[$60] allow normal topcoder members to create jobs #23

nkumar-topcoder opened this issue Dec 2, 2020 · 14 comments

Comments

@nkumar-topcoder
Copy link
Contributor

a) Currently, v5/jobs validates for bookingmanager role for job creation. This should be changed to allow for all Topcoder Members "Topcoder User" roles.
b) update POST /v5/jobs to allow all auth user access(include bookingmanager and connectmember as well as normal auth user)
c) update PATCH/PUT/DELETE /v5/jobs/:jobId to allow normal auth user to access the job he/she created. bookingmanager and connectmember can access all jobs as before.
d) update swagger doc

@nkumar-topcoder nkumar-topcoder added the enhancement New feature or request label Dec 2, 2020
@nkumar-topcoder nkumar-topcoder self-assigned this Dec 2, 2020
@veshu
Copy link
Contributor

veshu commented Dec 2, 2020

@nkumar-topcoder, please sign-up with Topcoder X tool

This is an automated message for veshu via Topcoder X

@veshu
Copy link
Contributor

veshu commented Dec 2, 2020

@nkumar-topcoder, please sign-up with Topcoder X tool

This is an automated message for veshu via Topcoder X

@veshu
Copy link
Contributor

veshu commented Dec 2, 2020

@nkumar-topcoder, please sign-up with Topcoder X tool

This is an automated message for veshu via Topcoder X

@veshu
Copy link
Contributor

veshu commented Dec 2, 2020

@nkumar-topcoder, please sign-up with Topcoder X tool

This is an automated message for veshu via Topcoder X

@veshu
Copy link
Contributor

veshu commented Dec 2, 2020

Contest https://www.topcoder.com/challenges/30155268 has been created for this ticket.

This is an automated message for veshu via Topcoder X

@veshu
Copy link
Contributor

veshu commented Dec 2, 2020

Contest https://www.topcoder.com/challenges/30155268 has been updated - it has been assigned to aaron2017.

This is an automated message for veshu via Topcoder X

@imcaizheng
Copy link
Contributor

Fixed with PR #21

@imcaizheng
Copy link
Contributor

PR #25 updates swagger doc.

@nkumar-topcoder
Copy link
Contributor Author

nkumar-topcoder commented Dec 2, 2020

@imcaizheng

  1. I am posting as tc member for job candidates. Note that this member is already v5/users. Ideally Jobcandidate POSTING Should not be allowed for tc member. In this case - message should display as “ not allowed or authorised” But message “conflict” is coming.

  2. the log shows that, it’s POST v5/users, not sure why is it posting again ?
    a) My guess its trying to recreate a same user handle and getting conflict ?
    b) When creating JOB also it’s happening. This could be we validate for v5/skills and tc-member doesn’t have u-bann role ? (Note : we are discussing to enable v5/skills search for all members from u-bann side)

Can you please check.

Note : It’s happening for role tc member only, if booking manager role. Then it’s fine.
image

image

@imcaizheng
Copy link
Contributor

@nkumar-topcoder

  1. currently POST /jobCandidates can be accessed by all TC members as the source code suggests, see https://github.com/topcoder-platform/taas-apis/blob/feature/integration-test-fix/src/services/JobCandidateService.js#L56-L65

    We could apply access rules on the operation if you think it is needed.

  2. This could be we validate for v5/skills and tc-member doesn’t have u-bann role ? (Note : we are discussing to enable v5/skills search for all members from u-bann side)

    I don't think so. When we validate for v5/skills, we are using ubahn M2M token rather than the user token from the POST /jobs request, so there is no needs to enable v5/skills search for all members.

  3. I believe both conflict errors were caused by the getUserId function. Will look deep into that and get back to you later.

@nkumar-topcoder
Copy link
Contributor Author

@imcaizheng

  1. you are right, any tc member can post for a job. Functionality wise this is right. no changes needed.
  2. agreed.
  3. ok fine, thank you.

@imcaizheng
Copy link
Contributor

imcaizheng commented Dec 3, 2020

@nkumar-topcoder

My guess its trying to recreate a same user handle and getting conflict ?

Your guess is right.
It is possible the handle stored in your token was already used to create an ubahn user and associated with an userId other than the userId stored in your token.
So when the getUserId function tried to use the userId stored in your token to find an existing ubahn user, it got no record. It then attempted to create new ubahn user with the handle stored in your token, unsurprisingly, ending up conflict error.

Currently the data on Topcoder Dev are not reliable and stable, IMO. To avoid the conflict error, I would
suggest create a new tc member account with different username so you won't be messed up with any existing data.

Edit
Alternatively, You could find the conflicting ubhan user and correct its associated v3 userId(the externalId property) with the one in your user token.

@maxceem
Copy link
Contributor

maxceem commented Dec 7, 2020

The fix for the issue in this ticket works good.
To track and discuss more the issue with conflict error during user ubahn creating I've created a separate issue #46

@maxceem
Copy link
Contributor

maxceem commented Dec 7, 2020

Payment task has been updated: https://software.topcoder.com/review/actions/ViewProjectDetails?pid=30155268

This is an automated message for maxceem via Topcoder X

@maxceem maxceem added this to the v1.0 - Initial Launch milestone Feb 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants