瀏覽代碼

permissions get all

tags/0.1.0
Robin Thoni 9 年之前
父節點
當前提交
daa8c22870
共有 2 個文件被更改,包括 13 次插入0 次删除
  1. 2
    0
      src/Auth/Business/LuticateBusiness.php
  2. 11
    0
      src/Auth/Controller/LuticatePermissionsController.php

+ 2
- 0
src/Auth/Business/LuticateBusiness.php 查看文件

@@ -92,6 +92,8 @@ class LuticateBusiness
92 92
 
93 93
         $route->get("$prefix/permissions/$permission_name", "${ns}LuticatePermissionsController", "get",
94 94
             LuticatePermissions::PERM_GET);
95
+        $route->get("$prefix/permissions", "${ns}LuticatePermissionsController", "getAll",
96
+            LuticatePermissions::PERM_GET);
95 97
         $route->post("$prefix/permissions/add/$permission_name/$permission_value", "${ns}LuticatePermissionsController",
96 98
             "add", array(LuticatePermissions::PERM_ADD, LuticatePermissions::PERM_GET));
97 99
         $route->post("$prefix/permissions/$permission_name/del", "${ns}LuticatePermissionsController", "del",

+ 11
- 0
src/Auth/Controller/LuticatePermissionsController.php 查看文件

@@ -45,6 +45,17 @@ class LuticatePermissionsController extends LuController {
45 45
         return LuticatePermissionsBusiness::get($permission_name);
46 46
     }
47 47
 
48
+    /**
49
+     * Get all permissions
50
+     * @param int $page The page number, 0 based
51
+     * @param int $perPage The number of items per page
52
+     * @return \Luticate\Utils\LuMultipleDbo
53
+     */
54
+    public function getAll($page = 0, $perPage = PHP_INT_MAX)
55
+    {
56
+        return LuticatePermissionsBusiness::getAll($page, $perPage);
57
+    }
58
+
48 59
     /**
49 60
      * Add a permission
50 61
      * @param $permission_name string The permission name

Loading…
取消
儲存