Description of permissions of agents, merchants, investment managers, and employees in CRM

Source: Internet
Author: User

each user should be set to query by group or by region. In this way, the design is more spiritual, and this can be unrelated to the user nature, only the settings are related
1. relationship between users and groups should be established
2. relationship between users and prefecture-level cities should be established
select groupid, operatorid from zy_yp1_group_operator
select areaid, operatorid from zy_yp1_city_operator
3. which query method is set for the user, that is, query by group or by prefecture-level city? You need to add a field to set whether the group or prefecture-level city is used

added the query method field qyerytype (all, prefecture-level city, group region) to the backend.
-- Agent
alter table dbo. zy_yp1_proxy add
qyerytype char (10) null
go
alter table dbo. zy_yp1_proxy add constraint
revoke default ''for qyerytype
go
Update zy_yp1_manager set querytype = 'prefecture-level city '
-- internal staff
begin transaction
alter table dbo. zy_sys2_ygbm add
qyerytype char (10) null
go
alter table dbo. zy_sys2_ygbm add constraint
export default ''for qyerytype
go
commit
Update zy_sys2_ygbm set querytype = 'all'
-- investment manager and specialist
begin transaction
alter table dbo. zy_yp1_manager add
qyerytype char (10) null
go
alter table dbo. zy_yp1_manager add constraint
expose default ''for qyerytype
go
commit
Update zy_yp1_manager set querytype = 'group region' -- or prefecture-level cities
-- write an error query, the error is returned.

added a function to determine the current user's query method, data from the control group and prefecture-level cities shows that
Test Users
admin users
p00023 286655 agency employees (specialists)
zzh 911911 Investment Manager
zy001 0000 Investment Promotion specialist

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.