Browse Source

permissions filter

tags/0.1.0
Robin Thoni 8 years ago
parent
commit
2b269dcfae

+ 3
- 2
src/Auth/Controller/LuticatePermissionsController.php View File

69
      * Get all permissions
69
      * Get all permissions
70
      * @param int $page The page number, 0 based
70
      * @param int $page The page number, 0 based
71
      * @param int $perPage The number of items per page
71
      * @param int $perPage The number of items per page
72
+     * @param string $query The filter query
72
      * @return \Luticate\Utils\LuMultipleDbo
73
      * @return \Luticate\Utils\LuMultipleDbo
73
      */
74
      */
74
-    public function getAll($page = 0, $perPage = PHP_INT_MAX)
75
+    public function getAll($page = 0, $perPage = PHP_INT_MAX, $query = "")
75
     {
76
     {
76
-        return LuticatePermissionsBusiness::getAll($page, $perPage);
77
+        return LuticatePermissionsBusiness::getAll($page, $perPage, $query);
77
     }
78
     }
78
 
79
 
79
     /**
80
     /**

+ 5
- 0
src/Auth/DataAccess/LuticatePermissionsDataAccess.php View File

19
         return array(array("name", "ASC"));
19
         return array(array("name", "ASC"));
20
     }
20
     }
21
 
21
 
22
+    protected static function getQueryPredicate($query)
23
+    {
24
+        return array(array("name", "ilike", "%" . $query . "%", "or"));
25
+    }
26
+
22
     public static function getEffectivePermission($user_id, $permission_name)
27
     public static function getEffectivePermission($user_id, $permission_name)
23
     {
28
     {
24
         return SpLuGetUserPermission::execute($user_id, $permission_name)->getVal();
29
         return SpLuGetUserPermission::execute($user_id, $permission_name)->getVal();

Loading…
Cancel
Save