radiegtya / meteoris2

a Realtime Javascript Boilerplate base on Meteor Js Framework
MIT License
246 stars 46 forks source link

Where should functions like isAdmin go? #58

Open JulianKingman opened 9 years ago

JulianKingman commented 9 years ago

I'm new to Meteoris, where should a function like isAdmin() go, which would check a user ID? Better yet, is this something that could be included in meteoris? Perhaps isRole('role', '_Id') would be better.

Thanks!

radiegtya commented 9 years ago

Hi Julian, I'll try to make some helpers about this. Btw for now You can easily check what role does an user have by checking it's Meteor.user.profile.mugenRoleGroupId, "1" mean admin, "2" mean authenticated user.

Regards

JulianKingman commented 9 years ago

Thanks! How do I apply that to a particular user? I was also curious, in general, about where 'utility' functions like that would go, according to your folder convention.

radiegtya commented 9 years ago

@JulianKingman : have You seen my video tutorial about user roles? I think You can understand how to do that from there. If you want to deeply take a look about the code, you can look at mugen folder.