Skip to content

Problem with $user->syncGroups #276

@ondequadre

Description

@ondequadre

I don't know exactly if I am doing something wrong or there is a problem with syncGroups()

If I do this:

$groups = "'" . implode("', '", $this->request->getPost('groups')) . "'";
$user->syncGroups($groups);

Returns this error:

CodeIgniter\Shield\Authorization\AuthorizationException #401
'admin', 'user' is not a valid group. 

if I manually insert the groups:

$user->syncGroups('admin','user');

then it works...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions