Changeset 4873

Show
Ignore:
Timestamp:
09/02/08 22:34:06 (10 months ago)
Author:
jwage
Message:

A few more documentation fixes.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/1.0/docs/cookbook/en/record-based-retrieval-security-template.txt

    r4871 r4873  
    77We have a list of accounts, their related sales and all sorts of sensitive information for each account. Each logged in user should be allowed 
    88to only view the accounts and related information based off their credentials + either the division, district, branch or salesperson they are allowed to view. 
     9 
    910So a division manager can view all info for all accounts within his division. A salesperson can only view the accounts they are assign. 
    1011 
     
    332333 
    333334<code type="php"> 
    334   $accounts = Doctrine_Query::create()->from('Account a')->leftJoin('a.Branches b')->where('a.company_name LIKE ?','A%')->execute(); 
     335$accounts = Doctrine_Query::create()->from('Account a')->leftJoin('a.Branches b')->where('a.company_name LIKE ?','A%')->execute(); 
    335336</code> 
    336337 
     
    339340<code> 
    340341SELECT ... FROM accounts a2 LEFT JOIN branches b2 ON a2.branch_id = b2.id LEFT JOIN divisions d2 ON a2.division_id = d2.id LEFT JOIN user_divisions u2 ON d2.id = u2.division_id WHERE a2.company_name LIKE ? AND u2.user_id = ? ORDER BY a2.company_name 
    341 <code> 
     342</code> 
    342343 
    343344The results you get back will always be restricted to the division you have been assigned. Since in our schema we've defined restrictions on the Branch and Districts as well