-
Notifications
You must be signed in to change notification settings - Fork 17
IBX-9266: Added REST endpoint loading available site accesses for location #1759
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
base: 4.6
Are you sure you want to change the base?
Conversation
alongosz
left a comment
There was a problem hiding this 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:
| */ | ||
| public function visit(Visitor $visitor, Generator $generator, $data): void | ||
| { | ||
| $generator->startObjectElement('SiteAccessesList'); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
src/lib/REST/Output/ValueObjectVisitor/SiteAccess/SiteAccessesListVisitor.php
Outdated
Show resolved
Hide resolved
1860d6c to
0f54bf7
Compare
|



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 existingSiteaccessResolverInterfacethat 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: