Assign existing role to user documentation

3 posts, 0 answers
  1. Trevor
    Trevor avatar
    15 posts
    Member since:
    Apr 2014

    Posted 04 Nov 2015 Link to this post

    Hi

    I want to assign an existing role to a user upon registration via cloud code. (If this is not possible with registration, I need to assign a role after the creation of a user.)

     

    I am reading the documentation on this page, but the link within it does not work:

    http://docs.telerik.com/platform/backend-services/javascript/access-control/roles/roles-javascript-sdk.html

    http://docs.telerik.com/platform/backend-services/rest/security/roles/ (not working)

     

    How do I assign a role to a user with cloud code?

    Regards

     

  2. Trevor
    Trevor avatar
    15 posts
    Member since:
    Apr 2014

    Posted 04 Nov 2015 Link to this post

    Figured it out, but someone still needs to update the above mentioned page.

     

            var attrs = {
                Role: "​12398127319783123" //the role id
            };
            ​.....Users.register(username, password, attrs); 

  3. Pavel
    Admin
    Pavel avatar
    6 posts

    Posted 06 Nov 2015 Link to this post

    Hi Trevor,

    Thank you for contacting us, and thank you for the suggestion. We will review the mentioned pages.

    I am glad to see you were able to solve your problem. Keep in mind that if you want to assign the same role to all registered user you can change the default role for registered users in the portal as mentioned here.

    If you need any further assistance, do not hesitate to contact us again.

    Regards,
    Pavel
    Telerik
     
    Everlive is now Telerik Backend Services, and is part of the Telerik Platform.
     
Back to Top