Meteor-Community-Packages / meteor-roles

Authorization package for Meteor, compatible with built-in accounts packages
http://meteor-community-packages.github.io/meteor-roles/
MIT License
920 stars 164 forks source link

Could add custom fields? #325

Closed thearabbit closed 4 years ago

thearabbit commented 4 years ago

Could add custom fields? for example type field: core, account, loan....

SimonSimCity commented 4 years ago

@thearabbit as long as you understand what the fields and their relations are, you're all free to go. The set is put together in a way that it should be easy for you to do these things.

thearabbit commented 4 years ago

thanks for your reply. Could you example to add new field on roles collection with Roles.createRole, Roles.addRolesToParent? Like the Users collection, we could create custom field in profiles field!

SimonSimCity commented 4 years ago

Well, the command Roles.createRoles() returns the _id property of the newly inserted document, which you can use to adjust to your needs, if you really want to change the role ...

Btw - which version of this package are you refering to?

thearabbit commented 4 years ago

It mean that

Meteor.roles.update(..........)
SimonSimCity commented 4 years ago

Yeah, just use the id you got as a return value of Roles.createRoles().

thearabbit commented 4 years ago

thanks 👍