Hi All,
I got an issue with the security group management its not working with custom modules properly, it works only with core modules.
I was tested in fresh installation.
- For leads modules it works fine.
Manager is able to see all records, and Team lead is able to see his records and his team members records, finally Team member only able see his records, - For custom module its not working properly
Manage is able to see all records, Team lead is able to see only his data, and tl not able to see his team members data, team members is able to see his records.
here are the two(lead and testmodule) list view queries, looks fine, no difference.
SELECT leads.id , LTRIM(RTRIM(CONCAT(IFNULL(leads.first_name,”),’ ‘,IFNULL(leads.last_name,”)))) as name,
leads.first_name , leads.last_name , leads.salutation , leads.status , leads.account_name , leads.account_id , leads.phone_work ,
jt0.user_name assigned_user_name , jt0.created_by assigned_user_name_owner ,
‘Users’ assigned_user_name_mod, leads.date_entered , leads.assigned_user_id FROM leads
LEFT JOIN leads_cstm ON leads.id = leads_cstm.id_c
LEFT JOIN users jt0 ON leads.assigned_user_id=jt0.id AND jt0.deleted=0 AND jt0.deleted=0
where
(
( leads.assigned_user_id =’f007f89f-8aa1-9865-7c64-55d1e800c591′
or EXISTS
(SELECT 1 FROM securitygroups secg INNER JOIN securitygroups_users secu ON secg.id = secu.securitygroup_id
AND secu.deleted = 0 AND secu.user_id = ‘f007f89f-8aa1-9865-7c64-55d1e800c591′
INNER JOIN securitygroups_records secr ON secg.id = secr.securitygroup_id
AND secr.deleted = 0 AND secr.module = ‘Leads’
WHERE secr.record_id = leads.id AND secg.deleted = 0)
)
)
AND leads.deleted=0 ORDER BY leads.date_entered DESC
SELECT testmodule.id , testmodule.name , testmodule.source ,
jt0.user_name assigned_user_name , jt0.created_by assigned_user_name_owner ,
‘Users’ assigned_user_name_mod, testmodule.assigned_user_id FROM testmodule
LEFT JOIN users jt0 ON testmodule.assigned_user_id=jt0.id AND jt0.deleted=0 AND jt0.deleted=0
where
(
( testmodule.assigned_user_id =’f007f89f-8aa1-9865-7c64-55d1e800c591′
or EXISTS
(SELECT 1 FROM securitygroups secg INNER JOIN securitygroups_users secu ON secg.id = secu.securitygroup_id
AND secu.deleted = 0 AND secu.user_id = ‘f007f89f-8aa1-9865-7c64-55d1e800c591′
INNER JOIN securitygroups_records secr ON secg.id = secr.securitygroup_id
AND secr.deleted = 0 AND secr.module = ‘testmodule’
WHERE secr.record_id = testmodule.id AND secg.deleted = 0)
)
)
AND testmodule.deleted=0 ORDER BY testmodule.date_entered DESC
Got stuck with it, appreciates your help.
thanks