Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBX-2493: Added option to invite other users to DXP & register from invitation #35

Merged
merged 20 commits into from
May 26, 2022

Conversation

ViniTou
Copy link
Contributor

@ViniTou ViniTou commented Apr 14, 2022

Question Answer
Tickets IBX-2493
Bug fix? no
New feature? yes
BC breaks? no
Tests pass? yes/no
Doc needed? yes
License GPL-2.0

Whats here:

  • User content type configurable by SA (based on: Made the user registration content type configurable #12)
  • Creation of SA based invitations with targets for user groups, roles, and roles limitations.
  • New policy & limitation to restrict who can invite who and where
  • Consuming invitations

Additional PRs:
ibexa/content-forms#29
ibexa/admin-ui#396

Checklist:

  • Implement tests
  • Coding standards ($ composer fix-cs)

src/bundle/Resources/storage/schema.yaml Outdated Show resolved Hide resolved
src/contracts/Invitation/Exception/InvitationExist.php Outdated Show resolved Hide resolved
src/contracts/Invitation/Exception/UserExist.php Outdated Show resolved Hide resolved
src/lib/Form/DataMapper/UserRegisterMapper.php Outdated Show resolved Hide resolved
src/lib/Form/Type/UserInvitationType.php Outdated Show resolved Hide resolved
src/lib/Form/Type/UserInvitationType.php Outdated Show resolved Hide resolved
src/lib/Permission/UserPermissionsLimitation.php Outdated Show resolved Hide resolved
@ViniTou ViniTou changed the title [WIP] IBX-2493: Added option to invite other users to DXP & register from invitation IBX-2493: Added option to invite other users to DXP & register from invitation May 12, 2022
src/lib/Form/ChoiceList/Loader/UserGroupsChoiceLoader.php Outdated Show resolved Hide resolved
src/bundle/Controller/UserRegisterController.php Outdated Show resolved Hide resolved
src/contracts/Invitation/Exception/InvitationExist.php Outdated Show resolved Hide resolved
src/contracts/Invitation/Exception/UserExist.php Outdated Show resolved Hide resolved
src/lib/Invitation/Persistence/Handler.php Outdated Show resolved Hide resolved
src/lib/Invitation/Persistence/Mapper.php Outdated Show resolved Hide resolved
src/lib/Invitation/Persistence/Mapper.php Outdated Show resolved Hide resolved
src/lib/Invitation/Persistence/Mapper.php Outdated Show resolved Hide resolved
src/lib/Permission/InvitationPolicyProvider.php Outdated Show resolved Hide resolved
@ViniTou ViniTou requested a review from adamwojs May 17, 2022 10:18
src/bundle/Controller/UserInvitationController.php Outdated Show resolved Hide resolved
src/bundle/Controller/UserInvitationController.php Outdated Show resolved Hide resolved
src/bundle/Controller/UserRegisterController.php Outdated Show resolved Hide resolved
src/lib/Invitation/DomainMapper.php Outdated Show resolved Hide resolved
src/lib/Invitation/InvitationHashGenerator.php Outdated Show resolved Hide resolved
src/lib/Invitation/InvitationService.php Outdated Show resolved Hide resolved
src/lib/Invitation/InvitationService.php Outdated Show resolved Hide resolved
src/lib/Invitation/MailSender.php Outdated Show resolved Hide resolved
src/contracts/Invitation/Invitation.php Outdated Show resolved Hide resolved
src/bundle/Resources/config/services/controllers.yaml Outdated Show resolved Hide resolved
src/lib/Form/Type/SectionsChoiceType.php Outdated Show resolved Hide resolved
src/lib/Invitation/InvitationHashGenerator.php Outdated Show resolved Hide resolved
@ViniTou ViniTou requested a review from adamwojs May 26, 2022 09:26
@ViniTou ViniTou force-pushed the ibx-2493-user-invitations branch from ebc8470 to 1d19c34 Compare May 26, 2022 09:35
@ViniTou ViniTou force-pushed the ibx-2493-user-invitations branch from 1d19c34 to b50a782 Compare May 26, 2022 09:56
Copy link
Contributor

@Steveb-p Steveb-p left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Integration tests would be awesome.

autoconfigure: true
public: false
arguments:
- '@=service("kernel").locateResource("@IbexaUserBundle/Resources/config/storage/schema.yaml")'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may allow developers to overwrite our schema. Shouldn't we hardcode it instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If someone wants to shot himself in the foot, he can. This is how we do it all across the codebase, so maybe this is just a feature ;)

src/bundle/Resources/config/services/controllers.yaml Outdated Show resolved Hide resolved
->setDefaults([
'choice_loader' => ChoiceList::lazy(
$this,
fn () => $this->loadFilteredRoles(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing third argument ($vary). It''s not immediately visible here, but this choice list depends on current user context.

This means that this form type, used elsewhere on page, may contain incorrect list.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All changed to CallbackChoiceLoader.

src/lib/Form/Type/Invitation/UserGroupChoiceType.php Outdated Show resolved Hide resolved
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\OptionsResolver\OptionsResolver;

final class SiteAccessChoiceType extends AbstractType
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tbh it's not a User related form type. This could be extracted to core. @alongosz ?

This may or may not relate to other form types in this PR.

Copy link
Contributor Author

@ViniTou ViniTou May 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Core does not include a single Type and I think it should stay this way. Even more, Siteaccesses are not part of the contracts there, so I would rather leave them here as there is no good place for that and SectionsChoiceType. I will just move them to Invitation namespace to be clear about the intent.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't mind adding a form type, but it seems generic, that's all. Ability to select site access is not limited to ibexa/user package.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally agree, there is just no good place for it atm in my opinion. (aside from adminUI maybe, but we have reversed dependency here).

src/lib/Invitation/InvitationService.php Outdated Show resolved Hide resolved
src/lib/Invitation/Persistence/Mapper.php Outdated Show resolved Hide resolved
tests/lib/Invitation/InvitationServiceTest.php Outdated Show resolved Hide resolved
@ViniTou ViniTou requested a review from Steveb-p May 26, 2022 12:48
@ViniTou ViniTou merged commit fda7714 into main May 26, 2022
@ViniTou ViniTou deleted the ibx-2493-user-invitations branch May 26, 2022 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants