Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Relay Base Person Connector Ldap Bundle Laravel Package

dbp/relay-base-person-connector-ldap-bundle

View on GitHub
Deep Wiki
Context7

Example Customizations

Customization

The bundle sends out certain events you can hook on to inject specific information in an event subscriber. Please take a look at the Event Subscriber Documentation of the bundle for more information.

If you don't need any customization, you don't need to implement any event subscribers, but the ones needed by the software package you are using.

Check-in

For the Check-In project you need to set ROLE_SCOPE_LOCATION-CHECK-IN and ROLE_SCOPE_LOCATION-CHECK-IN-GUEST as ldap-roles for the person. You can do that by implementing an event subscriber for the PersonFromUserItemPostEvent event.

Please take a look at the PersonFromUserItemPostEvent Documentation of the bundle for more information.

An event subscriber receives a \Dbp\Relay\BasePersonConnectorLdapBundle\Event\PersonFromUserItemPostEvent instance in a service for example in src/EventSubscriber/PersonFromUserItemSubscriber.php:

<?php

declare(strict_types=1);

namespace App\EventSubscriber;

use Dbp\Relay\BasePersonConnectorLdapBundle\Event\PersonFromUserItemPostEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

class PersonFromUserItemSubscriber implements EventSubscriberInterface
{
    public static function getSubscribedEvents(): array
    {
        return [
            PersonFromUserItemPostEvent::NAME => 'onPost',
        ];
    }

    public function onPost(PersonFromUserItemPostEvent $event)
    {
        $person = $event->getPerson();

        // TODO: Add code to decide what roles a user has.
        $roles = ['ROLE_SCOPE_LOCATION-CHECK-IN', 'ROLE_SCOPE_LOCATION-CHECK-IN-GUEST'];
        $person->setExtraData('ldap-roles', $roles);

        $event->setPerson($person);
    }
}

Afterwards best do a composer install to make sure caches are cleared and everything is in order.

Greenlight

Greenlight project you need to set ROLE_SCOPE_GREENLIGHT as ldap-roles for the person. You can do that by implementing an event subscriber for the PersonFromUserItemPostEvent event.

Please take a look at the PersonFromUserItemPostEvent Documentation of the bundle for more information.

An event subscriber receives a \Dbp\Relay\BasePersonConnectorLdapBundle\Event\PersonFromUserItemPostEvent instance in a service for example in src/EventSubscriber/PersonFromUserItemSubscriber.php:

<?php

declare(strict_types=1);

namespace App\EventSubscriber;

use Dbp\Relay\BasePersonConnectorLdapBundle\Event\PersonFromUserItemPostEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

class PersonFromUserItemSubscriber implements EventSubscriberInterface
{
    public static function getSubscribedEvents(): array
    {
        return [
            PersonFromUserItemPostEvent::NAME => 'onPost',
        ];
    }

    public function onPost(PersonFromUserItemPostEvent $event)
    {
        $person = $event->getPerson();

        // TODO: Add code to decide what roles a user has.
        $roles = ['ROLE_SCOPE_GREENLIGHT'];
        $person->setExtraData('ldap-roles', $roles);

        $event->setPerson($person);
    }
}

Afterwards best do a composer install to make sure caches are cleared and everything is in order.

ESign

Esign project you need to set the roles you set in config/packages/dbp_relay_esign.yaml as ldap-roles for the person if it should have permission to the signature profile. You can do that by implementing an event subscriber for the PersonFromUserItemPostEvent event.

Please take a look at the PersonFromUserItemPostEvent Documentation of the bundle for more information.

An event subscriber receives a \Dbp\Relay\BasePersonConnectorLdapBundle\Event\PersonFromUserItemPostEvent instance in a service for example in src/EventSubscriber/PersonFromUserItemSubscriber.php:

<?php

declare(strict_types=1);

namespace App\EventSubscriber;

use Dbp\Relay\BasePersonConnectorLdapBundle\Event\PersonFromUserItemPostEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

class PersonFromUserItemSubscriber implements EventSubscriberInterface
{
    public static function getSubscribedEvents(): array
    {
        return [
            PersonFromUserItemPostEvent::NAME => 'onPost',
        ];
    }

    public function onPost(PersonFromUserItemPostEvent $event)
    {
        $person = $event->getPerson();

        // TODO: Add code to decide what roles a user has.
        // These are the scopes you set in `config/packages/dbp_relay_esign.yaml`
        $roles = ['ROLE_SCOPE_YOUR_SCOPE1', 'ROLE_SCOPE_YOUR_SCOPE2'];
        $person->setExtraData('ldap-roles', $roles);

        $event->setPerson($person);
    }
}

Afterwards best do a composer install to make sure caches are cleared and everything is in order.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
bugban/symfony
beyonder-capi/workflow-extensions-bundle
beyonder-capi/job-queue-bundle
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin