Created
August 11, 2014 16:44
-
-
Save Austio/34e44ca30ba9a3ee8275 to your computer and use it in GitHub Desktop.
Simple Multi-tenancy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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