Created
April 18, 2013 14:02
-
-
Save etdsoft/5412932 to your computer and use it in GitHub Desktop.
Workaround to add per-project authorisation to Dradis Pro (danger! ugly hack ahead) This will restrict access to project 84 to the 81, 85 and 86 users.
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 ProjectsController < AuthenticatedController | |
before_filter :deny_access, :only => [:show, :destroy, :use] | |
// ... | |
protected | |
def deny_access | |
if (params[:id].to_i == 84) && ![81,85,86].include?(current_user.id) | |
redirect_to projects_path, :alert => 'Sorry, but the Force is not sufficiently strong within you to work on that project. Choose another one (and continue your training).' | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment