Hi, I have a problem with Anonymous user…
I would that anonymous user can display (without authentication) only one page of my application.
I create the controller like this:
@ UiController(“MyObjAnonymous.browse”)
@ UiDescriptor(“MyObjAnonymous-browse.xml”)
@ LookupComponent(“myObjTable”)
@ LoadDataBeforeShow
@ Route(path = “test”)
public class MyObjAnonymousBrowse extends StandardLookup {
@ Inject
private CollectionLoader myObjDl;@ Subscribe public void onAfterShow(AfterShowEvent event) { myObjDl.load(); }
}
In the descriptor I have the dataloader (myObjDc) and the table to display the data (myObjTable)
<collection id=“myObjDc” class=“entity.myObj” view=“_local”>
<loader id=“myObjDl”>
<query>
<![CDATA[select e from myObj e]]>
</query>
</loader>
</collection>
in the web-app.properties I add the line
cuba.web.allowAnonymousAccess = true
and in the administration i create a user Anonymous e a role able to display MyObjAnonymousBrowse in the tab screen and in the tab UI the component myObjTable (read only) contains in this screen.
So seems it’s works fine but when I go to the url
http://localhost:8080/app/#test
MyObjAnonymousBrowse is displayed but the data is not loaded.
I see in debug that myObjDl.load(); doesn’t load anything even if I have 3 element in the myObj table, indeed if I log in the application and click on the same component the 3 element is displayed.
What am I doing wrong?