the self.layers was being assigned in update_create_resources but is needed in edit too. Moving this to before the functions means both can use it.
The task was returning false if the user didn't have permissions, when in fact it should return true as a login was successful, but their permissions are checked in finshed()
This PR is just to fix two issues: