How to create new permission that can show my custom menu panel in pimcore plugin?

I created new custom panel using my custom pimcore plugin . i need to create new
custom permission in role . so when this permission is checked. my panel is show.

I created new role for this and need to create custom permission for show this panel.
Please help me

I got the answer.
we can create custom permision in plugin installer using this code.

private $permissionsToInstall = [
 private function installPermissions()
    foreach ($this->permissionsToInstall as $permission) {
        $definition = Permission\Definition::getByKey($permission);

        if ($definition) {
                '     <comment>WARNING:</comment> Skipping permission "%s" as it already exists',


        try {
        } catch (\Throwable $e) {
            throw new AbortMigrationException(sprintf(
                'Failed to create permission "%s"',

and u can use this in your js to hide and show
like that

You also could just simply add a entry into the database table users_permission_definitions


1 Like