Skip to content
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

Meteor: option not to update the collection #530

Closed
welelay opened this issue Aug 25, 2015 · 7 comments
Closed

Meteor: option not to update the collection #530

welelay opened this issue Aug 25, 2015 · 7 comments

Comments

@welelay
Copy link

welelay commented Aug 25, 2015

My collections are never allowed to be modified on client.
I perform the reordering myself in the onSort hook so the UI works.

However I get errors because Sortable tries to update ordering:

Error invoking Method 'rubaxa:sortable/collection-update': Collection <pages> is not Sortable. Please add it to Sortable.collections in server code. [403] meteor.js:888:11
update failed: Access denied undefined

Would it be possible to add an option to prevent updating the collection?
Thanks,

@welelay
Copy link
Author

welelay commented Aug 25, 2015

@dandv this is meteor related

@nlfonseca
Copy link

+1

@LewisW
Copy link

LewisW commented Sep 8, 2015

The PR #543 does something similar to this, although it only allows overriding the add and remove events.

@RubaXa
Copy link
Collaborator

RubaXa commented Feb 5, 2016

Dear all! Meteor is moved to the separate repository. If this issue is still actual, please create it there once again.

For your info: this project needs a maintainer.

@welelay
Copy link
Author

welelay commented Feb 8, 2016

created SortableJS/meteor-sortablejs#3

@d4nyll
Copy link

d4nyll commented Feb 13, 2016

You need to define an allow rule for the collection Sortable is writing to:

<collection>.allow({
    update: function (userId, doc) {
        // For example
        if (Roles.userIsInRole(userId, 'admin')) {
            return true;
        }
    }
});

@welelay
Copy link
Author

welelay commented Feb 15, 2016

@d4nyll I don't update collections on client for any user.

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

No branches or pull requests

5 participants