简体   繁体   中英

Assign Role when user login APIGEE + USERGRID

I am new in APIGEE + Usergrid , I am using function for user login below

client.login(username, password,
      function (err) {
        if (err) {
          alert('Invalid username or password.');
          $(".ajax_loader").hide();
          $("#login-btn").show();
        } else {
          //login succeeded
          client.getLoggedInUser(function(err, data, user) {

and I want to assign permission and Role when user login into Application using script My problem is when I assign Role and Permission using dashboard (APIGEE Dashboard) after Signup, Login user able to ADD/EDIT/DELETE, But I want to set Role and Permission using script, Please let me know How to assign Role and permission When user login into Application.

Thanks Vipin S

To do this, you would use the assignRole function. Search for "Usergrid.Entity.prototype.assignRole" in apigee.js for more details.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM