Merge pull request #18522 from Hystepik/develop_v13#1
Fix #18519 : Modulebuilder api permission
This commit is contained in:
commit
12ce4bf7af
@ -69,7 +69,7 @@ class MyModuleApi extends DolibarrApi
|
|||||||
*/
|
*/
|
||||||
public function get($id)
|
public function get($id)
|
||||||
{
|
{
|
||||||
if (!DolibarrApiAccess::$user->rights->mymodule->read) {
|
if (!DolibarrApiAccess::$user->rights->mymodule->myobject->read) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -194,7 +194,7 @@ class MyModuleApi extends DolibarrApi
|
|||||||
*/
|
*/
|
||||||
public function post($request_data = null)
|
public function post($request_data = null)
|
||||||
{
|
{
|
||||||
if (!DolibarrApiAccess::$user->rights->mymodule->write) {
|
if (!DolibarrApiAccess::$user->rights->mymodule->myobject->write) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
// Check mandatory fields
|
// Check mandatory fields
|
||||||
@ -222,7 +222,7 @@ class MyModuleApi extends DolibarrApi
|
|||||||
*/
|
*/
|
||||||
public function put($id, $request_data = null)
|
public function put($id, $request_data = null)
|
||||||
{
|
{
|
||||||
if (!DolibarrApiAccess::$user->rights->mymodule->write) {
|
if (!DolibarrApiAccess::$user->rights->mymodule->myobject->write) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -260,7 +260,7 @@ class MyModuleApi extends DolibarrApi
|
|||||||
*/
|
*/
|
||||||
public function delete($id)
|
public function delete($id)
|
||||||
{
|
{
|
||||||
if (!DolibarrApiAccess::$user->rights->mymodule->delete) {
|
if (!DolibarrApiAccess::$user->rights->mymodule->myobject->delete) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
$result = $this->myobject->fetch($id);
|
$result = $this->myobject->fetch($id);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user