Hi, I have created an app to use for employees only on a campsite , to report and track issues as they arise. I made it as a private app but couldn’t publish it as the empoyees are seasonal and don’t have company email accounts, and we don’t have an EMM console. I have been advised to make it public, but to use security for who can log in. How do I create a private admin screen in the app that only i will have access to, in order to create accounts and passwords for the employees (using the ‘create account for someone else’ and ‘assign a temporary password to user’ actions’)?
Many thanks!
James
As usual with Bubble, there are several ways to do this. I’m going to describe one way, I’m sure others will be happy to describe other methods.
- Add a field to the “user” data type called “admin” and set it to “yes/no”.
- Go to the app data tab in the editor, find your user account, and manually set your user account’s admin field to “yes”.
- Create a page, name it something like “admin”. Set up a workflow on page load where any user who’s “admin” field is empty or is no will be redirected to the index page.
- On your admin page, create a group and call it “content”. Add a conditional to the group that it does not display unless the current user’s “admin” is “yes”. Place all page content inside this group.
Now you have a private page that only you can access where you can create new users, etc.
Thank you, that works brilliantly!
Next question though… I have set up the admin page, with the create account for someone else and assign temporary password but there is no password being created - or do i need add something else to the workflow after assign temporary password or am i looking in the wrong place?
Many thanks
James
Correct, you need another action step that references “result of step 2” (or whatever your “create a temporary password” action step is). The “result” of that step will be the temporary password itself, so it’s up to you if you want to email that to them or just display it on the page so you can write it down to hand to them physically, etc. Make sense?
Sorry, I don’t understand. which action do I need to apply so I can create a password for the staff member (I don’t need to email it - we are a very small team and there is no personal details on the app, I won’t even use their real e-mail address to set them up)
Again, there are many ways to do this but here is one method that comes to mind if you just want to see the temporary password that gets generated:
You could have a group on the page with its data type set to “text” but leave the data source blank. In your workflow, right after the “generate temporary password” step, you could “display data in a group” that is the result of that prior step. Within that group, have a text element that displays its parent group’s data, which in this case is a text value (the temporary password).
I think there are actually 2 different cases here:
-
If you want Bubble to generate a password for the staff user, use “Create an account for someone else”, then “Assign a temp password to a user”, then use the Result of step 2 however you want. As @BrianHenderson mentioned, one simple way to see that generated password is to display the Result of step 2 in a group/text element on the page.
-
If you want to choose the password yourself, use “Create an account for someone else”, then “Assign a temp password to a user”, then “Change another user’s credentials” to replace the temporary password with the final password you want to set.
The only thing I’d add is that, for security, it’s better to handle this in a backend workflow if possible, especially if you’re generating or exposing passwords on the page.
Thanks for the help, I used the “create an account for someone else”, followed by “Assign a temporay password to a user” and then “update the user’s credentials”, with Old password - result of step 2 (assign a temp password), change password checked and New password “1234”. I also tried “Aribitrary text - 1234” but although the account was created, the password wasn’t recognised. What am I doing wrong?!
Side note, my password for my main Admin account is no longer accepted, I can no longer log in - why would that have changed?
Okay, looks like it is sorted; thank you both for your help