Make user account which makes user accounts filter to see only accounts which that user creates

i need to make user role type which can create user accounts of different role. example being a teacher who can create student accounts then each teacher can see the students which they have created and edit they’re grades (field update) my issue is being new to backendless i can not figure out the way to change user roles and then to use 1 page to create user under that role and bind a field to the teacher automatically without user even knowing that it happened

Hey Joe.

Welcome to the community. Are you developing with UI Builder or some other UI dev tool?

The process can be as follows:

  1. You should have a login page/screen
  2. User logs in and you check if the user has the “teacher” role.
  3. If the user has the “teacher” role, redirect to the page/screen where teachers can perform their functions. Otherwise, redirect the user to a page/screen that corresponds to the role(s) they have.
  4. To create new users and associate them with a specific role, create a custom API service in Backendless that will perform the function. The API service can be restricted to be called only by users in specific role(s). The restrictions can be done either for all service’s methods or at the individual method level.

Please share what you already have so we can guide you further.

Regards,
Mark

but how can i make the users role set when they sign up and how can the teacher automatically pass their name into a field when creating student accounts

im useing backendless

Hello, @joe_joe

When a teacher creates a student account, you can set up the process so everything happens automatically in the background. The student will get the student role, and a reference to the teacher will be saved to the student’s record - without the teacher needing to fill out extra information.

Your backend logic should handle this after the teacher submits the new student’s details:

  • Assign the student role to the new user.
  • Save a reference to the teacher’s user account in a related field (for example, teacherId) on the student’s record.

This keeps your data structure clean: each student is always linked to the correct teacher, and you can access the teacher’s information through this relation whenever you need it. The teacher only needs to enter the student’s details.

Kind regards,
Karyna