|
@@ -5,6 +5,7 @@ namespace Luticate\Auth\Business;
|
5
|
5
|
use Luticate\Utils\LuBusiness;
|
6
|
6
|
use Luticate\Auth\DataAccess\LuticatePermissionsDataAccess;
|
7
|
7
|
use Luticate\Auth\DBO\LuticatePermissionsDbo;
|
|
8
|
+use Luticate\Utils\LuMultipleDbo;
|
8
|
9
|
|
9
|
10
|
class LuticatePermissionsBusiness extends LuBusiness {
|
10
|
11
|
protected static function getDataAccess()
|
|
@@ -33,17 +34,15 @@ class LuticatePermissionsBusiness extends LuBusiness {
|
33
|
34
|
|
34
|
35
|
public static function getAllEffectivePermission($user_id)
|
35
|
36
|
{
|
36
|
|
- return LuticatePermissionsDataAccess::getAllEffectivePermission($user_id);
|
37
|
|
- }
|
38
|
|
-
|
39
|
|
- public static function getEffectivePermissionMe($user, $permission_name)
|
40
|
|
- {
|
41
|
|
- return self::getEffectivePermission($user->getId(), $permission_name);
|
42
|
|
- }
|
43
|
|
-
|
44
|
|
- public static function getAllEffectivePermissionMe($user)
|
45
|
|
- {
|
46
|
|
- return self::getAllEffectivePermission($user->getId());
|
|
37
|
+ $values = LuticatePermissionsDataAccess::getAllEffectivePermission($user_id);
|
|
38
|
+ $dbos = [];
|
|
39
|
+ foreach ($values as $value) {
|
|
40
|
+ $dbo = new LuticatePermissionsDbo();
|
|
41
|
+ $dbo->setName($value->getPermissonName());
|
|
42
|
+ $dbo->setValue($value->getVal());
|
|
43
|
+ $dbos[] = $dbo;
|
|
44
|
+ }
|
|
45
|
+ return new LuMultipleDbo(count($dbos), $dbos);
|
47
|
46
|
}
|
48
|
47
|
|
49
|
48
|
public static function getEffectiveDynamicPermission($user_id, $permission_name, $resource_id)
|