Skip to content

Instantly share code, notes, and snippets.

@Austio
Created August 11, 2014 16:44
Show Gist options
  • Save Austio/34e44ca30ba9a3ee8275 to your computer and use it in GitHub Desktop.
Save Austio/34e44ca30ba9a3ee8275 to your computer and use it in GitHub Desktop.
Simple Multi-tenancy
class SomeController < ApplicationController
before filter :check_authorized
authorized_roles = ["platinum", "gold"]
def check_authorized
redirect_to no_way_sucka_path, :notice => "No Way!" unless authorized_roles.include? current_user.role
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment