In Meteor.js, how do one generally give different users (say depending on a field role in the users collection, which can have values like admin, users, testers) different versions of the site (both clientside and serverside)?
Serving different version of website to different users in Meteor.js
220 Views Asked by Nyxynyx At
1
There are 1 best solutions below
Related Questions in JAVASCRIPT
- Angular Show All When No Filter Is Supplied
- Why does a function show up as not defined
- I count the time the user takes to solve my quiz using Javascript but I want the same time displayed on another page
- Set "More" "Less" font size
- Using pagination on a table in AngularJS
- How to sort these using Javascript or Jquery Most effectively
- how to fill out the table with next values in array with one button
- State with different subviews
- Ajax jQuery firing multiple time display event for the same result
- Getting and passing MVC Model data to AngularJS controller
- Disable variable in eval
- javascript nested loops waiting for user input
- .hover() seems to overwrite .click()
- How to sort a multi-dimensional array by the second array in descending order?
- How do I find the fonts that are not loading in a CORS situation ( MoovWeb )?
Related Questions in NODE.JS
- How to solve CERT_UNTRUSTED error in nodemailer
- Run a loop over a callback, node js
- Implementing prerender.io middleware in sails.js
- Token based authorization in nodejs/ExpressJs and Angular(Single Page Application)
- formatting path string in javascript
- One to One screensharing using WEBRTC
- Create polygon from grid (for collisions)
- Strange npm behavior when installing packages like grunt
- Convert JSON.gz to JSON in node js
- "Your npm version is outdated." but it's not. While install yo
- Why put methods on the prototype of a class instead of declaring them in the constructor?
- Node JS Async Response
- mongoose get property from nested schema after `group`
- Cannot Receive Incoming call on Twilio android Client
- How can I change a specific line in a file with node js?
Related Questions in METEOR
- Meteor: How to save files with 'submit form' instead of 'change' events
- Meteor MapReduce Package Error: A method named is already defined
- how to resolve the 'unknown provider' angular injectr error when adding third party angular directives to angular-meteor app
- Meteor: get template name in spacebars
- What are the benefits of using the fields option when querying in Meteor
- Why are numbers being inserted into MongoDB incorrectly?
- iron:router check if route loaded with history.back
- How to get auto-completion for meteor API working on Visual Studio?
- Is there a manual way of telling Spiderable to consider the page “ready”?
- android sdk install error EPIPE
- How to create a temporary cursor in meteor
- How to add menus/ subtopics for meteor site?
- Passing values from an array to child template in meteor
- Materialize: Style of navbar search input broken when using typeahead.js (meteor)
- maintaining the data context with a modal and Iron Router?
Related Questions in METEORITE
- Meteor - No login services configured
- using relationship in collection
- How to backup Backup mongo db in meteorjs as mongodump is not working
- Meteor deploy error on meteor host
- Serving different version of website to different users in Meteor.js
- Cannot get Meteor to run on iOS device
- Not able to run mrt command with meteor
- meteor.js Template helpers as variable vs key+value
- Meteor package images are not shown on production server
- Heroku Toolbelt Stuck Administering Deleted App
- datatables are not updating in meteorjs
- onmouseenter and click function doesn't works together
- Render the meteor template manually when database changes occur
- Deploy meteor/meteorite to heroku
- Wrong version of node used when deploying Meteor
Related Questions in AB-TESTING
- Are You Allowed to AB Test IAP Quantities?
- Android: Visual A/B Testing library
- Google Experiments A/B Transaction Tracking
- How to enable particular feature in android app for specified users based on city using A/B Testing
- How can I a/b test a rails app without third-party software?
- Serving different version of website to different users in Meteor.js
- Are there any good strategies for A/B testing on mobile devices?
- Build a simple django A/B Testing framework
- Any tips for deploying a new revision of a rails view?
- Split Testing and Optimization Techniques
- Analytics Experiments Dynamic URLs
- A/B testing app features via Google Play Developer Console
- Force a specific test-variant as preview in google optimize
- best ways to dynamically load config in java?
- Is it correct to make segmentation of data for A/B test by target metric?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
First, I am using Iron Router for my routing. At some point I may drop it and write my own, at least for this project, as I am not using half of the features, but for now this is what I have.
For roles I am using the
alanning:rolespackage. Again, I could probably write my own, but it does what I need it too for now, so I am happy with it.Next I have a custom package I wrote. In it I set up a template for signin and signout, with routes etc. I also provide a utility class that provides a function called
authenticationRequired. This function will check if the current user is logged in, and if roles are passed in that they have those roles. The code looks like this:Now, in my
Routerrouter I do something like:There are a few moving parts around all of this, but that's the jest of it. In the onBeforeAction of the route, check if the user has the required role. If not, send them to the notAuthorize page. If they are, let them through. I am still missing a few pieces that I haven't worked out yet in this code, but it works for the most part.
Hope that gives you a jumping-off point.