|
@@ -63,7 +63,13 @@ class LuticateBusiness
|
63
|
63
|
|
64
|
64
|
$permissions[] = LuticatePermissions::USER_LOGIN;
|
65
|
65
|
foreach ($permissions as $permission) {
|
66
|
|
- if (!LuticatePermissionsBusiness::getUserPermission(self::$_currentUser->getId(), $permission)) {
|
|
66
|
+ try {
|
|
67
|
+ $perm = LuticatePermissionsBusiness::getEffectivePermission(self::$_currentUser->getId(), $permission);
|
|
68
|
+ if (!$perm->getValue()) {
|
|
69
|
+ return "Permission denied";
|
|
70
|
+ }
|
|
71
|
+ }catch (\Exception $e)
|
|
72
|
+ {
|
67
|
73
|
return "Permission denied";
|
68
|
74
|
}
|
69
|
75
|
}
|
|
@@ -120,12 +126,20 @@ class LuticateBusiness
|
120
|
126
|
$route->post("$prefix/groups/$group_id/delUser/$user_id", "${ns}LuticateGroupsBusiness", "delUser", LuticatePermissions::GROUP_DEL_USER);
|
121
|
127
|
|
122
|
128
|
|
|
129
|
+ $route->post("$prefix/permissions/effective/$user_id/$permission_name", "${ns}LuticatePermissionsBusiness", "getEffectivePermission", LuticatePermissions::PERM_EFFECTIVE_GET);
|
|
130
|
+ $route->post("$prefix/permissions/effective/me/$permission_name", "${ns}LuticatePermissionsBusiness", "getEffectivePermissionMe");
|
|
131
|
+
|
|
132
|
+ $route->post("$prefix/permissions/$permission_name", "${ns}LuticatePermissionsBusiness", "get", LuticatePermissions::PERM_GET);
|
123
|
133
|
$route->post("$prefix/permissions/add/$permission_name/$permission_value", "${ns}LuticatePermissionsBusiness", "add", LuticatePermissions::PERM_ADD);
|
124
|
134
|
$route->post("$prefix/permissions/$permission_name/del", "${ns}LuticatePermissionsBusiness", "del", LuticatePermissions::PERM_DEL);
|
125
|
135
|
$route->post("$prefix/permissions/$permission_name/edit/$permission_value", "${ns}LuticatePermissionsBusiness", "edit", LuticatePermissions::PERM_EDIT);
|
|
136
|
+
|
|
137
|
+ $route->post("$prefix/permissions/group/$group_id/$permission_name", "${ns}LuticatePermissionsGroupsBusiness", "get", LuticatePermissions::PERM_GROUP_GET);
|
126
|
138
|
$route->post("$prefix/permissions/group/$group_id/add/$permission_name/$permission_value", "${ns}LuticatePermissionsGroupsBusiness", "add", LuticatePermissions::PERM_GROUP_ADD);
|
127
|
139
|
$route->post("$prefix/permissions/group/$group_id/$permission_name/del", "${ns}LuticatePermissionsGroupsBusiness", "del", LuticatePermissions::PERM_GROUP_DEL);
|
128
|
140
|
$route->post("$prefix/permissions/group/$group_id/$permission_name/edit/$permission_value", "${ns}LuticatePermissionsGroupsBusiness", "edit", LuticatePermissions::PERM_GROUP_EDIT);
|
|
141
|
+
|
|
142
|
+ $route->post("$prefix/permissions/user/$user_id/$permission_name", "${ns}LuticatePermissionsUsersBusiness", "get", LuticatePermissions::PERM_USER_GET);
|
129
|
143
|
$route->post("$prefix/permissions/user/$user_id/add/$permission_name/$permission_value", "${ns}LuticatePermissionsUsersBusiness", "add", LuticatePermissions::PERM_USER_ADD);
|
130
|
144
|
$route->post("$prefix/permissions/user/$user_id/$permission_name/del", "${ns}LuticatePermissionsUsersBusiness", "del", LuticatePermissions::PERM_USER_DEL);
|
131
|
145
|
$route->post("$prefix/permissions/user/$user_id/$permission_name/edit/$permission_value", "${ns}LuticatePermissionsUsersBusiness", "edit", LuticatePermissions::PERM_USER_EDIT);
|