Skip to content

Instantly share code, notes, and snippets.

@etdsoft
Created April 18, 2013 14:02
Show Gist options
  • Save etdsoft/5412932 to your computer and use it in GitHub Desktop.
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.
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