Hello! I'm C# WinForms/WPF developer.How I can create new user in Milestone? I found users in [AspNetUsers] and in other tables... How to add a new user (user role) correctly? What's the sequence?

You can add and update roles through the ManagementServer.RoleFolder property: https://doc.developer.milestonesys.com/html/index.html?base=miphelp/class_video_o_s_1_1_platform_1_1_configuration_items_1_1_management_server.html&tree=tree_search.html?search=managementserver

Have a look at the following example to see how to generally work with these classes: https://doc.developer.milestonesys.com/html/index.html?base=samples/componentsamples/configaddcameras/readme.html&tree=tree_2.html

Thanks Peter!

But first I need to create a new user (base user) in “database” Surveillance IDP\AspNetUsers? Using Milestone libraries.

Dear Senior Engineering Manager.:slightly_smiling_face:

You shuold never work directly on the database. You can add basic users through ManagementServer.BasicUserFolder.

Could you please send a sample code or direct link to example with add, edit, remove users?

Thank you.

We don’t have a sample specifically on that, so you’ll have to write it yourself, but if you look at the sample I mentioned previously it should be pretty straightforward to work with basic users instead.

Thank for you answer. Have a nice weekend!

Could you please point out the correct classes that I should work with to create, edit and “delete” users and roles as you pointed me to a class that only contains a method for adding a user

If you look at the documentation for BasicUserFolder it should be fairly straight-forward to see how to remove users, and accessing existing users for editing: https://doc.developer.milestonesys.com/html/index.html?base=miphelp/class_video_o_s_1_1_platform_1_1_configuration_items_1_1_basic_user_folder.html&tree=tree_search.html?search=basicuserfolder

Pretty much same story for ManagementServer.RoleFolder: https://doc.developer.milestonesys.com/html/index.html?base=miphelp/class_video_o_s_1_1_platform_1_1_configuration_items_1_1_role_folder.html&tree=tree_search.html?search=rolefolder