Check if acls is populated before doing foreach
This commit is contained in:
parent
d8e8b94119
commit
b198848a47
1 changed files with 12 additions and 4 deletions
|
|
@ -159,9 +159,13 @@ class RoleController extends BaseController
|
|||
|
||||
// acl attributes
|
||||
$acl_attribs = $req->request->get('acl');
|
||||
foreach ($acl_attribs as $acl_key)
|
||||
|
||||
if (!empty($acl_attribs))
|
||||
{
|
||||
$row->addACLAccess($acl_key);
|
||||
foreach ($acl_attribs as $acl_key)
|
||||
{
|
||||
$row->addACLAccess($acl_key);
|
||||
}
|
||||
}
|
||||
|
||||
// validate
|
||||
|
|
@ -240,9 +244,13 @@ class RoleController extends BaseController
|
|||
|
||||
// then add
|
||||
$acl_attribs = $req->request->get('acl');
|
||||
foreach ($acl_attribs as $acl_key)
|
||||
|
||||
if (!empty($acl_attribs))
|
||||
{
|
||||
$row->addACLAccess($acl_key);
|
||||
foreach ($acl_attribs as $acl_key)
|
||||
{
|
||||
$row->addACLAccess($acl_key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue