This module allows you to restrict access to webforms and their submissions based on assigned domains.

Project link

https://www.drupal.org/project/domain_access_webform

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

    Comments

    ajay-mallah created an issue. See original summary.

    rushikesh raval’s picture

    Thank you for applying!

    Please read Review process for security advisory coverage: What to expect for more details and Security advisory coverage application checklist to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review.

    The important notes are the following.

    • If you have not done it yet, you should run phpcs --standard=Drupal,DrupalPractice on the project, which alone fixes most of what reviewers would report.
    • For the time this application is open, only your commits are allowed.
    • The purpose of this application is giving you a new drupal.org role that allows you to opt projects into security advisory coverage, either projects you already created, or projects you will create. The project status won't be changed by this application and no other user will be able to opt projects into security advisory policy.
    • We only accept an application per user. If you change your mind about the project to use for this application, or it is necessary to use a different project for the application, please update the issue summary with the link to the correct project and the issue title with the project name and the branch to review.

    To the reviewers

    Please read How to review security advisory coverage applications, Application workflow, What to cover in an application review, and Tools to use for reviews.

    The important notes are the following.

    • It is preferable to wait for a Code Review Administrator before commenting on newly created applications. Code Review Administrators will do some preliminary checks that are necessary before any change on the project files is suggested.
    • Reviewers should show the output of a CLI tool only once per application.
    • It may be best to have the applicant fix things before further review.

    For new reviewers, I would also suggest to first read In which way the issue queue for coverage applications is different from other project queues.

    rushikesh raval’s picture

    Remember to change status, when the project is ready to be reviewed. In this queue, projects are only reviewed when the status is Needs review.

    vishal.kadam’s picture

    Assigned: ajay-mallah » Unassigned
    Issue summary: View changes
    Issue tags: -Needs security review
    ajay-mallah’s picture

    Status: Active » Needs review
    vishal.kadam’s picture

    Status: Needs review » Needs work

    1. FILE: domain_access_webform.module

    /**
     * @file
     * Primary module hooks for domain_access_webform module.
     */

    Drupal does not have primary and secondary hooks. Instead of that, it is preferable to use the usual description: Hook implementations for the [module name] module. where [module name] is the name of the module given in its .info.yml file.

    /**
     * Implements hook_query_TAG_alter().
     */
    function domain_access_webform_query_domain_webform_filter_alter(AlterableInterface $query) {

    The description for that hook should also say for which tag that hook is implemented.

    /**
     * Implements hook_entity_presave().
     *
     * Maps domain id on new werform create/duplicate.
     */
    function domain_access_webform_webform_presave(WebformInterface $entity) {

    Please update the hook description to reflect the correct usage. The hook_ENTITY_TYPE_presave() hook is being used. Additionally, specify the entity for which this hook is implemented.

    2. FILE: src/DomainWebformService.php

      /**
       * Sets class variables.
       *
       * @param \Drupal\Core\Entity\EntityTypeManager $entityTypeManager
       *   Manages entity type plugin definitions.
       * @param \Drupal\Core\Logger\LoggerChannelFactory $logger
       *   Describes a logger instance.
       * @param \Drupal\Core\Session\AccountInterface $currentUser
       *   Defines an account interface which represents the current user.
       */
      public function __construct(

    FILE: modules/domain_webform_mapper/src/DomainWebformMapper.php

      /**
       * Sets class variables.
       *
       * @param \Drupal\Core\Entity\EntityTypeManager $entityTypeManager
       *   Manages entity type plugin definitions.
       * @param \Drupal\Core\Logger\LoggerChannelFactory $logger
       *   Describes a logger instance.
       */
      public function __construct(

    FILE: modules/domain_webform_mapper/src/Form/WebformDomainUpdateForm.php

      /**
       * Constructs the service objects.
       *
       * Class constructor.
       */
      public function __construct(EntityTypeManagerInterface $entityTypeManager, FileSystem $fileSystem) {

    FILE: modules/domain_webform_mapper/src/Form/WebformSubmissionDomainUpdateForm.php

      /**
       * Constructs the service objects.
       *
       * Class constructor.
       */
      public function __construct(EntityTypeManagerInterface $entityTypeManager, FileSystem $fileSystem) {

    The documentation comment for constructors is not mandatory anymore, If it is given, the description must be Constructs a new [class name] object. where [class name] includes the class namespace.

    ajay-mallah’s picture

    Hii @vishalkadam
    I have made the suggested changes can you please review them, if I need to make more changes

    ajay-mallah’s picture

    Status: Needs work » Needs review
    vishal.kadam’s picture

    Rest seems fine to me.

    Let’s wait for other reviewers to take a look and if everything goes fine, you will get the role.

    avpaderno’s picture

    As a side note, it will not be possible to opt this project into security advisory coverage until July 16, 2024.

    vishal prasad’s picture

    @apaderno can you please Review it again as its already 19th July.

    vishal.kadam’s picture

    Priority: Normal » Major

    I am changing priority as per Issue priorities.

    avpaderno’s picture

    Priority: Major » Normal
    Status: Needs review » Needs work
    • The following points are just a start and don't necessarily encompass all the changes that may be necessary
    • A specific point may just be an example and may apply in other places
    • A review is about code that does not follow the coding standards, contains possible security issues, or does not correctly use the Drupal API; the single points are not ordered, not even by importance

    src/Plugin/views/filter/FilterWebformByDomain.php

    \Drupal\views\Plugin\views\filter\StringFilter is not part of the public API and it cannot be used as parent class. \Drupal\views\Plugin\views\filter\FilterPluginBase can instead be used, since that is a base class.

    vishal prasad’s picture

    Status: Needs work » Needs review

    @avpaderno I have added the suggested changes as per #13, please review.

    avpaderno’s picture

    Assigned: Unassigned » avpaderno

    This is an ajay-mallah's application; it is ajay-mallah who needs to make commits to fix what reported.

    vishal prasad’s picture

    @avpaderno Its @ajay-mallah who has made fixes of #13 and committed the changes.

    and being the co maintainer of the module, I have equal contribution in this module development so I am commenting here.

    avpaderno’s picture

    Status: Needs review » Needs work

    It's ajay-mallah who needs to reply here and make the necessary changes, not every project maintainer.
    This is not an application to review what the project maintainers as group understand about writing secure code which correctly uses the Drupal API and follows the Drupal coding standards. This is ajay-mallah's application.

    ajay-mallah’s picture

    Status: Needs work » Needs review

    @avpaderno, I have made the changes as per the suggestions in #13. I was occupied with a project, so I assigned the co-maintainer @vishal-prasad to verify the changes and commit them to the discussion thread. In the future, I will handle the suggested changes myself.

    avpaderno’s picture

    Status: Needs review » Needs work

    Changing the parent class is not sufficient. The methods implemented by (and the code used in) StringFilter are different from the methods implemented by (and the code used in) FilterPluginBase.

    Furthermore, FilterPluginBase is an abstract class. It means there are methods it does not implement which should be instead implemented by the child classes.

    avpaderno’s picture

    Assigned: avpaderno » Unassigned
    ajay-mallah’s picture

    Status: Needs work » Needs review

    @avpaderno,
    Based on your suggestions, I reviewed the module code, refactored it, and removed unnecessary sections to enhance the module's clarity and performance.

    rushikesh raval’s picture

    Status: Needs review » Needs work

    1. 1.0.x-alpha is a wrong name for a branch. Release branch names always end with the literal .x as described in Release branches.

    ajay-mallah’s picture

    Status: Needs work » Needs review

    Updated the branch, Please review.

    vishal prasad’s picture

    Priority: Normal » Major

    as Its already been more than 2 months for this issue to be in the state of review, so changing the priority

    klausi’s picture

    Status: Needs review » Fixed
    Issue tags: +ContributionWeekend2025

    manual review:
    domain_webform_mapper.routing.yml: use permissions instead of roles to control access, which is more flexible.

    Looks good to me otherwise.

    Thanks for your contribution, Ajay!

    I updated your account so you can opt into security advisory coverage now.

    Here are some recommended readings to help with excellent maintainership:

    You can find lots more contributors chatting on Slack or IRC in #drupal-contribute. So, come hang out and stay involved!

    Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

    Thanks to the dedicated reviewer(s) as well.

    Status: Fixed » Closed (fixed)

    Automatically closed - issue fixed for 2 weeks with no activity.