Javascript Application and User Roles

I am looking to establish three roles for my application

-Owner : Different self registration page then “customers”
-Employee : Can be created by an “owner”
-Customer : Can self register and should be auto assigned this role

I cannot figure this out from the docs (which seem way out of sync then the current version BTW). I think that this must be done in the Business Logic, but

  1. how do I distinguish between the three “registration” events from above and still have it “secure”
  2. how do I assign a role in the JS Business Logic (JS Business Logic does not seem to be documented anywhere)
  1. When a user is being registered, it has no roles. A role must be assigned to a user object.

  2. API for assigning a role to a user is currently available via REST and in Java. The rest documentation is available at:
    https://backendless.com/documentation/users/rest/users_user_roles.htm

Regards,
Mark