Assign permissions dynamically to users in the application

Assign permissions dynamically to users in the application

Requirement

When a customer is added to the application, the application is instantly shared with the user, with the required permissions.

Use Case

In the order management application, a customer might sign up on the go once the business is live. All non-administrator users of the application should be given appropriate permissions —for example, a customer can view their orders and products. A vendor can see their products and the performance of those products. Appropriate permissions need to be assigned to the users who sign up as a customer or a vendor.

Steps to follow

1. Create two forms with the following details:
Form
Form Link Name
Field Type
Field Name
Field Link Name
Vendor
Vendor
Name
Name
Name
Address
Address
Address
Email
Email
Email
Customer
Customer
Name
Name
Name
Address
Address
Address
Email
Email
Email

The Email field holds the email address with which a customer or a vendor logs in to Zoho Creator to access the order management application.
 
2. Create the different sets of permissions for different users. In the application's Settings, click User Permissions under Permissions. Then, click the Add Permission button.
 
3. Give relevant permissions for the customers and click Save.
 
4. Similarly, create a permission set for Vendors and click Save.
 
5. Create a workflow to execute when a Customer record is added.
 
6. Click Add New Action, then click Deluge Script. Add the below code to assign the permission set Customer to the customer's email.
  1. //share the application with customer with Customer permission
  2. thisapp.permissions.assignUserInProfile(input.Email,"Customer");
  3. //Send notification mail with link to access the application
  4. sendmail
  5. [
  6. from :zoho.adminuserid
  7. to :input.Email
  8. subject :"Invitation to access Order Management"
  9. message :"Hi,<div><br></div><div>You have been successfully added as a Customer.</div><div><br></div><div>Click&nbsp;<a href=\"" + " https://app.zohocreator.com" + zoho.appuri + "\"" + " target=\"_blank\">here</a>&nbsp;to access \"Order Management\"</div><div><br></div><div>Regards,</div><div>" + zoho.adminuser + "</div>"
  10. ]

7. Similarly, create a workflow to execute when a Vendor is added.
 
8. Click Add New Action, then click Deluge Script. Add the below code to assign the permission set Vendor to the vendor's email.
  1. //share the application with customer with Vendor permission
  2. thisapp.permissions.assignUserInProfile(input.Email,"Vendor");
  3. //Send notification mail with link to access the application
  4. sendmail
  5. [
  6. from :zoho.adminuserid
  7. to :input.Email
  8. subject :"Invitation to access Order Management"
  9. message :"Hi,<div><br></div><div>You have been successfully added as a Vendor.</div><div><br></div><div>Click&nbsp;<a href=\"" + " https://app.zohocreator.com" + zoho.appuri + "\"" + " target=\"_blank\">here</a>&nbsp;to access \"Order Management\"</div><div><br></div><div>Regards,</div><div>" + zoho.adminuser + "</div>"
  10. ]

See how it works



    Zoho DataPrep Personalized Demo

    If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

    Zoho CRM Training

      Create, share, and deliver

      beautiful slides from anywhere.

      Get Started Now





              Zoho CRM Training Programs

              Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

              Zoho CRM Training

                  Zoho SalesIQ Resources



                      Zoho TeamInbox Resources




                                Zoho DataPrep Resources

                                  Zoho DataPrep Demo

                                  Get a personalized demo or POC

                                  REGISTER NOW


                                    Design. Discuss. Deliver.

                                    Create visually engaging stories with Zoho Show.

                                    Get Started Now











                                                          • Related Articles

                                                          • Custom access permissions for app users

                                                            Requirement Create custom permissions for an application and assign them to relevant users. Use case In a human resources management application, users need to be assigned with different access levels, based on their designation. For example, ...
                                                          • Track software development lifecycle

                                                            Requirement   Use Blueprints feature to track and manage the process of software development. Use Case   A software company uses blueprints to track and manage the software development lifecycle. Various blueprint actions are needed to mark the ...
                                                          • Permission based reports and a consolidated report

                                                            Requirement             Set visibility of forms and reports based on teams. Management should be able to view all the reports consolidated in to one. Use Case   A firm tracks its suppliers details using the Supply Management app. The app has four ...
                                                          • Filter report using dynamic values from a function

                                                            Requirement When a user accesses a report, data is filtered based on the logged-in user's role so that only the required details are visible to the user. Use Case An employee management system has two forms, Department and Employees. The Department ...
                                                          • Schedule a monthly email with report as pdf

                                                            Requirement Schedule a monthly sales report to the sales manger in a PDF with stats on achieved sales versus target for the month. Use Case A sales management app records sales activities and numbers to track the performance of its sales team and the ...

                                                          Resources

                                                          Videos

                                                          Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                          eBooks

                                                          Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                          Webinars

                                                          Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                          CRM Tips

                                                          Make the most of Zoho CRM with these useful tips.



                                                            Zoho Show Resources