Now i create dirty code for restrict Organisation information from Agents. Rules is simply. Organisation has account manager which can be as aAgent and Team. My rule access work if agent is on team (which is accaunt manager of organisation) or if agent is account manager.
I hope i explain is clear. A little code.
File: orgs.inc.php. Only for 1.10.4
57c57
< $orgs->values('id', 'name', 'created', 'updated');
$orgs->values('id', 'name','manager' ,'created', 'updated');
134d133
<
135a135,136
$issetaccess=False;
$ispresent = 0;
138c139,155
< ?>
// add access for users and teams for org
if (substr($org['manager'],0, 1) == 't') {
mb_internal_encoding("UTF-8");
$ispresent=$thisstaff->isTeamMember(mb_substr($org['manager'],1));
if ($ispresent == 1)
$issetaccess=True;
} else {
mb_internal_encoding("UTF-8");
$ispresent=mb_substr($org['manager'],1);
if ($ispresent == $thisstaff->getID())
$issetaccess=True;
}
if ($thisstaff->isAdmin() == 1)
$issetaccess=True;
if ($issetaccess == True){
//end of access rules
?>
149a167
}
P.S.
Next step is create access to stuff of organisation use accaunt manager rules.