Changeset 4874

Show
Ignore:
Timestamp:
09/02/08 18:35:47 (18 months ago)
Author:
jwage
Message:

Removing new lines

Files:
1 modified

Legend:

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

    r4873 r4874  
    11++ Introduction 
    22 
    3 This is a tutorial & how-to on using a security template and listener to restrict a user to specific records, or a range of 
    4 specific records based on credentials and a user table association. Basically fine grained user access control. 
    5  
    6 This template was created for a project which had a few credentials, division_manager, district_manager, branch_manager, and salesperson. 
    7 We have a list of accounts, their related sales and all sorts of sensitive information for each account. Each logged in user should be allowed 
    8 to only view the accounts and related information based off their credentials + either the division, district, branch or salesperson they are allowed to view. 
     3This is a tutorial & how-to on using a security template and listener to restrict a user to specific records, or a range of specific records based on credentials and a user table association. Basically fine grained user access control. 
     4 
     5This template was created for a project which had a few credentials, division_manager, district_manager, branch_manager, and salesperson. We have a list of accounts, their related sales and all sorts of sensitive information for each account. Each logged in user should be allowed to only view the accounts and related information based off their credentials + either the division, district, branch or salesperson they are allowed to view. 
    96 
    107So a division manager can view all info for all accounts within his division. A salesperson can only view the accounts they are assign. 
    118 
    12 The template has been a work in progress so the code below may not actually be the final code I'm using today. But since it is now working for all situations  
    13 I'm asking of it, I thought I would post it as is. 
     9The template has been a work in progress so the code below may not actually be the final code I'm using today. But since it is now working for all situations I'm asking of it, I thought I would post it as is. 
    1410 
    1511++ Template 
     
    143139++ YAML schema syntax 
    144140 
    145 Here is the schema I used this template with. I've removed lots of extra options, other templates I was using, indexes and table names. It may not work out of  
    146 the box without the indexes - YMMV. 
     141Here is the schema I used this template with. I've removed lots of extra options, other templates I was using, indexes and table names. It may not work out of the box without the indexes - YMMV. 
    147142 
    148143<code type="yaml"> 
     
    322317++ User setup 
    323318 
    324 In my case, I create users and provide a checkbox for their credentials, one for each type I have. Lets take Division Manager as an example.  
    325 In my case we have 3 divisions, East, Central, West. When I create a user I assign it the West division, and check off that they are a division manager. 
    326 I can then proceed to login, and my account listing page will restrict the accounts I see automatically to my division. 
     319In my case, I create users and provide a checkbox for their credentials, one for each type I have. Lets take Division Manager as an example. In my case we have 3 divisions, East, Central, West. When I create a user I assign it the West division, and check off that they are a division manager. I can then proceed to login, and my account listing page will restrict the accounts I see automatically to my division. 
    327320 
    328321++ Querying 
     
    342335</code> 
    343336 
    344 The 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 
    345 if I were to want to provide a user with a drop down of potential branches, I can simply query the branches as I normally would, and only the ones in my division would be 
    346 returned to choose from. 
     337The 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 if I were to want to provide a user with a drop down of potential branches, I can simply query the branches as I normally would, and only the ones in my division would be returned to choose from. 
    347338 
    348339++ Restrictions 
    349340 
    350 For the time being, this module only protects tables in the FROM clause, since doctrine currently runs the query listener for the new tables added to the query by the template,  
    351 and thus we get a pretty nasty query in the end that doesn't work. If I can figure out how to detect such situations reliably I'll update the article. 
     341For the time being, this module only protects tables in the FROM clause, since doctrine currently runs the query listener for the new tables added to the query by the template, and thus we get a pretty nasty query in the end that doesn't work. If I can figure out how to detect such situations reliably I'll update the article.