Skip to content

Conversation

@barw4
Copy link
Contributor

@barw4 barw4 commented Oct 28, 2025

🎫 Issue IBX-9266

Related PRs:

ibexa/fieldtype-richtext#267

Description:

A new endpoint is exposed as /api/ibexa/v2/siteaccess/load-non-admin-for-location/{locationId} that utilizes the existing SiteaccessResolverInterface that fetches eligible site accesses for a given location.

Example response

{
  "SiteAccessesList": {
    "_media-type": "application/vnd.ibexa.api.SiteAccessesList+json",
    "values": [
      {
        "_media-type": "application/vnd.ibexa.api.SiteAccess+json",
        "name": "__default_site_access__",
        "provider": "Ibexa\\Core\\MVC\\Symfony\\SiteAccess\\Provider\\StaticSiteAccessProvider"
      },
      {
        "_media-type": "application/vnd.ibexa.api.SiteAccess+json",
        "name": "__second_site_access__",
        "provider": "Ibexa\\Core\\MVC\\Symfony\\SiteAccess\\Provider\\StaticSiteAccessProvider"
      },
      {
        "_media-type": "application/vnd.ibexa.api.SiteAccess+json",
        "name": "ger",
        "provider": "Ibexa\\Core\\MVC\\Symfony\\SiteAccess\\Provider\\StaticSiteAccessProvider"
      },
      {
        "_media-type": "application/vnd.ibexa.api.SiteAccess+json",
        "name": "eng",
        "provider": "Ibexa\\Core\\MVC\\Symfony\\SiteAccess\\Provider\\StaticSiteAccessProvider"
      },
      {
        "_media-type": "application/vnd.ibexa.api.SiteAccess+json",
        "name": "ku6\"H",
        "provider": "Ibexa\\Core\\MVC\\Symfony\\SiteAccess\\Provider\\StaticSiteAccessProvider"
      }
    ]
  }
}

For QA:

Documentation:

@barw4 barw4 self-assigned this Oct 28, 2025
@barw4 barw4 added the Feature New feature request label Oct 28, 2025
@barw4 barw4 marked this pull request as ready for review October 28, 2025 09:16
@barw4 barw4 requested a review from a team October 28, 2025 09:48
@ezrobot ezrobot requested review from Steveb-p, ViniTou, adamwojs, alongosz, ciastektk, konradoboza, mikadamczyk, tbialcz and wiewiurdp and removed request for a team October 28, 2025 09:49
Copy link
Member

@alongosz alongosz left a comment

Choose a reason for hiding this comment

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

Conceptually I think this is the proper placement for the endpoint.
Other remarks:

Comment on lines 134 to 135
ibexa.rest.siteaccess.load_for_location:
path: /siteaccess/load-non-admin-for-location/{locationId}
Copy link
Member

Choose a reason for hiding this comment

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

This should be site_access and site-access for route name and path respectively. These are separate words. Alternatively SiteAccess which doesn't apply here I think. I know we have mistakes in this codebase for namespaces (it's not consistent, sometimes Siteaccess, sometimes SiteAccess, but here I'd see this as new code, which should be correct.

*/
public function visit(Visitor $visitor, Generator $generator, $data): void
{
$generator->startObjectElement('SiteAccessesList');
Copy link
Member

Choose a reason for hiding this comment

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

My preference here would be SiteAccessList similarly as we refer to it on other places afair and the same as ContentInfoList, LocationList, etc.

Copy link
Contributor Author

@barw4 barw4 Oct 28, 2025

Choose a reason for hiding this comment

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

The issue is that we also use SiteAccessesList in a lot of places in directly related services, e.g.: https://github.com/ibexa/admin-ui/blob/main/src/lib/Siteaccess/NonAdminSiteaccessResolver.php#L33 (a lot of other places in admin-ui), therefore I wanted to stay consistent with it as I'm directly using this service. But obviously I can change it if you prefer it your way.


use Ibexa\Rest\Value as RestValue;

final class SiteAccessesList extends RestValue
Copy link
Member

Choose a reason for hiding this comment

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

and the same remark for the object itself as in the previous comment.

@sonarqubecloud
Copy link

@barw4 barw4 requested a review from alongosz October 28, 2025 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature New feature request Ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants