From 6afbfe45183412e35e8e846fd0d4a9d846c8644b Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Wed, 6 Jul 2016 18:07:22 +0100 Subject: Use normal user authentication to control access to /admin - Adds is_superuser flag to User - Logged-in user must be a superuser or have from_body set in order to access anything within /admin - has_permission_to on a superuser will always return true - Only superusers can create/grant superusers - New `createsuperuser` command for creating superusers --- Vagrantfile | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Vagrantfile') diff --git a/Vagrantfile b/Vagrantfile index 31f645da7..80e79846d 100755 --- a/Vagrantfile +++ b/Vagrantfile @@ -49,12 +49,15 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # We want to be on port 3000 for development sed -i -r -e "s,^( *BASE_URL: .*)',\\1:3000'," fixmystreet/conf/general.yml fi + # Create a superuser for the admin + fixmystreet/bin/createsuperuser superuser@example.org password if [ $SUCCESS -eq 0 ]; then # All done echo "****************" echo "You can now ssh into your vagrant box: vagrant ssh" echo "The website code is found in: ~/fixmystreet" echo "You can run the dev server with: script/fixmystreet_app_server.pl [-d] [-r] [--fork]" + echo "Access the admin with username: superuser@example.org and password: password" else echo "Unfortunately, something appears to have gone wrong with the installation." echo "Please see above for any errors, and do ask on our mailing list for help." -- cgit v1.2.3