Hi everyone! I’ve got website with online lessons and I would like that new members could choose their badge between teacher and student on signup lightbox. Thank you so much in advance.
You could have a radio button for Teacher/Student. On change of radio button you would have an IF statement work out and set a field for the member with their badge type. You can then later assign the badge to the member once the member has been created.
https://www.wix.com/velo/reference/wix-users-backend/badges-obj
If you can wait a while, i will show you some cool stuff about this question…
Just a question! Do you realy talk about BADGES, or do you mean → ROLES ?
These a two different things!
For EXAMPLE!
A Teacher → can have several → BADGES…
Role : Teacher → Badges : [ MostClever, BiggestBrain, MonsterScientist …]
Ok, even if my project is still in developement, you can take a look on it here…
https://russian-dima.wixsite.com/login-system
There you can see an example-developement, of your expectations… (current-version-1.49).
I followed the instruction and what can I fix in my code to make it work?
import { badges } from ‘wix-users-backend’;
export function assignMembers ( badgeId , memberIds ) {
return badges . assignMembers ( badgeId , memberIds );
export function radioGroup1_change ( event ) {
if ( $w ( ‘#radioGroup1’ ). value === ‘Student’ ) {
assignMembers ( Student );
} else {
if ( $w ( ‘#radioGroup1’ ). value === ‘Teacher’ ) {
assignMembers ( Teacher );
Basically I want to make like teacher has hidden some pages on my site. Especially like page with a lessons to book, because I want teachers only to manage their booked lessons. And I’m looking for way to do this. I thought that creating a badges and then setting a special permissions to them in dashboard is a kinda great solution. Maybe you have any other ideas? Thank you for your answer by the way
Can you give me a setup-example of the mentioned situation?
In my shown example you surely have recognize, that students can’t enter teachers-pages, but teachers can visit students pages.
So first step is done → only teachers can enter their pages.
What next? You want teachers to edit just their own content? → set right DB-permissions.
Only teachers can’t enter some pages and i realized there is an option to set a badges permissions in dashboard, so it’s done. Now i just want to make that badge could be choosen in sign up form. I am totally beginner in coding and this is my first page ever. Could you give me some instruction how that code will work and look like? I really appreciate you want to help me in some way.
@biznesszymonczaja
I do not know, why you are using badges instead of roles.
I already tried to explain it somehere in another post, why using roles and not badges for it. ( i realized → it was this post )
Please take a look one more time here…
https://russian-dima.wixsite.com/login-system
You can create a new ACCOUNT → by choosing (for example) your own ROLE right during the registration prozess.
- Fill out the Registration form
- Choose your ROLE
- Choose your AVATAR (profile-pic)
- Register
You will be logged-in immediately without any proving process.
Do your testings and take also a look into the given RESULTS in the CONSOLE, when doing some actions.
You do not want to create an own ACCOUNT? → Use one of the predefined ones
Somewhere in your (member-management) DASHBOARD you will find this one…
In this section you can manage all your ROLES and their ACCESSES…
Here an setted-up ROLE in my Login-Example → for PRESIDENT…
Every ROLE gets an own ID…which is used to identify the right role of a user (you can find this ID also in the SETUP of my Login-System…
And on this Wix-DASHBOARD-SITE you can manage all permissions for every of your site-pages…
For example: → Log in a s → STUDENT ← and try to enter the given pages on this example-site…
Do the same, when logged-in as → PRESIDENT <—, what has been changed?
So what was the question one more time?
About ROLES →
https://www.wix.com/velo/reference/wix-users-backend/roles-obj
About BADGES —>
https://www.wix.com/velo/reference/wix-users-backend/badges-obj
So if this way of permission setup is still not enough for your use-case, than perhaps you in fact will need the BADGES.
But here, i will first have to code it, to show you more of example (sorry).
Stay tuned until my badge-system is READY!
@russian-dima Aaa okay I understand
So bagdes no needed in my case. I’ll try to code it by myself and wait for your results.
@biznesszymonczaja
Were you able to resolve your issue? Just wanted to ask you, because i will start working on my BADGE-MANAGEMENT-System soon. So if you have questions, perhaps i will be able to give you some hints, who knows.