Maurits van der Schee 7年前
コミット
470fca9353
1個のファイルの変更6行の追加2行の削除
  1. 6
    2
      README.md

+ 6
- 2
README.md ファイルの表示

@@ -596,14 +596,18 @@ for a specific CRUD action.
596 596
 By defining a 'record_filter' function you can apply a forced filter, for instance to implement roles in a database system.
597 597
 The rule "you cannot view unpublished blog posts unless you have the admin role" can be implemented with this filter.
598 598
 
599
-```return ($table=='posts' && $_SESSION['role']!='admin')?array('published,nis,null'):false;```
599
+```
600
+return ($table=='posts' && $_SESSION['role']!='admin')?array('published,nis,null'):false;
601
+```
600 602
 
601 603
 ## Multi-tenancy
602 604
 
603 605
 The 'tenancy_function' allows you to expose an API for a multi-tenant database schema. In the simplest model all tables have a column
604 606
 named 'customer_id' and the 'tenancy_function' is defined as:
605 607
 
606
-```return $col=='customer_id'?$_SESSION['customer_id']:null```
608
+```
609
+return $col=='customer_id'?$_SESSION['customer_id']:null
610
+```
607 611
 
608 612
 In this example ```$_SESSION['customer_id']``` is the authenticated customer in your API.
609 613
 

読み込み中…
キャンセル
保存