Skip to content

Make things support multi-owner#2454

Closed
upupzealot wants to merge 5 commits into
strongloop:masterfrom
upupzealot:master
Closed

Make things support multi-owner#2454
upupzealot wants to merge 5 commits into
strongloop:masterfrom
upupzealot:master

Conversation

@upupzealot

Copy link
Copy Markdown

When a model has two or more "belongsTo" relations, $owner will check
them all, instead of only checking the first one.

@slnode

slnode commented Jun 20, 2016

Copy link
Copy Markdown

Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test."

@0candy

0candy commented Jun 20, 2016

Copy link
Copy Markdown
Contributor

Thank you for submitting a PR. Please fix the long line:

/strongloop/loopback/common/models/role.js
  221:1  error  Line 221 exceeds the maximum line length of 100  max-len

Also, please add a unit test to verify your changes.

@upupzealot

upupzealot commented Jun 21, 2016

Copy link
Copy Markdown
Author

@0candy this is strange, because I don't change this line, it's original line 222 in role.js
It seems that code indentation is the reason, I would figure that out.

About the test, I will do that, but not sure how.
Should I add a test file under the /test folder or should I modify the role.test.js which already exists?

@0candy

0candy commented Jun 21, 2016

Copy link
Copy Markdown
Contributor

@upupzealot You're right, there is an extra indent for that line as it was moved into the if block.
As for the unit test, you can just add a test case to role.test.js. Thanks!

@slnode

slnode commented Jun 22, 2016

Copy link
Copy Markdown

Can one of the admins verify this patch?

@upupzealot

Copy link
Copy Markdown
Author

any progress?

@ahmed-abdulmoniem

Copy link
Copy Markdown

++++1

@slnode

slnode commented Oct 16, 2016

Copy link
Copy Markdown

Can one of the admins verify this patch?

3 similar comments
@slnode

slnode commented Oct 16, 2016

Copy link
Copy Markdown

Can one of the admins verify this patch?

@slnode

slnode commented Oct 16, 2016

Copy link
Copy Markdown

Can one of the admins verify this patch?

@slnode

slnode commented Oct 16, 2016

Copy link
Copy Markdown

Can one of the admins verify this patch?

@0candy

0candy commented Oct 17, 2016

Copy link
Copy Markdown
Contributor

@bajtos Please review.

@bajtos

bajtos commented Oct 18, 2016

Copy link
Copy Markdown
Member

I am not familiar with this part of our codebase, I believe @raymondfeng and/or @ritch are more suitable to review this patch.

BTW the code needs rebasing on top of the current master, test/role.test.js was changed quite a bit recently to fix intermittent test failure.

@VictorAlbertos

Copy link
Copy Markdown

Hi :)

Are you still planing to integrate this feature?

Thanks.

@ahmed-abdulmoniem

Copy link
Copy Markdown

+1

@upscreen

Copy link
Copy Markdown

Good day

When can we expect this feature to be available in the master?

Regards.

@0candy 0candy removed the triaging label Oct 28, 2016
@0candy

0candy commented Oct 28, 2016

Copy link
Copy Markdown
Contributor

@upupzealot Could you please rebase your code?

@raymondfeng Could you please review?

@upupzealot

Copy link
Copy Markdown
Author

@0candy conflict in the test. How to solve this?

@upupzealot

upupzealot commented Oct 29, 2016

Copy link
Copy Markdown
Author

Did "Allow edits from maintainers", hope it would help somehow.
But how to rebase a pull request.
Actually my work with loopback ends a month ago, maybe I should make a new pull request?

When a model has two or more "belongsTo"  relations, $owner will check
them all, instead of only checking the first one.
@0candy

0candy commented Oct 31, 2016

Copy link
Copy Markdown
Contributor

Hi @upupzealot , I rebased onto your branch, however some of the unit tests are failing. Could you please take a look? Thanks!

Comment thread common/models/role.js
@@ -210,26 +210,42 @@ module.exports = function(Role) {
if (callback) callback(null, matches(ownerId, userId));
return;
} else {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That way you allow multiple owner only when it's not base on the userId / owner field ... see https://github.com/strongloop/loopback/pull/3106/files for my implementation

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@pierreclr Hi, for some reason I'm no longer maintaining this pr, it's glad to see somebody else fulfilled the request for mult-owner. Hope to see this be merged into the matser soon.

@bajtos

bajtos commented Jan 19, 2017

Copy link
Copy Markdown
Member

Closing in favour of #3106

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants