This is a migrated thread and some comments may be shown as answers.

Assign existing role to user documentation

2 Answers 60 Views
Cloud Code
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Anthony
Top achievements
Rank 1
Anthony asked on 04 Nov 2015, 02:20 PM

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 Answers, 1 is accepted

Sort by
0
Anthony
Top achievements
Rank 1
answered on 04 Nov 2015, 02:51 PM

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); 

0
Pavel
Telerik team
answered on 06 Nov 2015, 12:46 PM
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.
 
Tags
Cloud Code
Asked by
Anthony
Top achievements
Rank 1
Answers by
Anthony
Top achievements
Rank 1
Pavel
Telerik team
Share this question
or