YAG-Gallery / yag

YAG - Yet Another Gallery
http://www.yag-gallery.de
31 stars 34 forks source link

RBAC Permissions not working #86

Closed matthias-g closed 7 years ago

matthias-g commented 8 years ago

I'm running Typo3 7.6.4 with YAG 4.1.2 and I wanted my frontend users to be able to upload pictures and create galleries and albums. So I created a page with the plugin in mode "Gallery List" and added the following TS:

plugin.tx_ptextbase.settings.rbac.extensions.yag.feGroups {
  1 {
    10 = admin
  }
}

I'm using the default theme. As far as I understand the docs this should be enough to display the links to create a gallery in the list. But they don't show up.

So I looked into the code and found that the view helper used in the template is rbac.hasAccess. This view helper in pt_extbase uses rbacService->loggedInUserHasAccess to determine whether an action is allowed or not. The injected service is one implementing the interface Tx_PtExtbase_Rbac_RbacServiceInterface. There are three implementations of this interface. A dummy that always returns false (RbacService), an AllowAllService, and the TypoScriptRbacService which is the service that contains the functionality we actually want. The problem in my case is that extbase always injects the RbacService instead of the TypoScriptRbacService. So the rbacService's loggedInUserHasAccess always returns false and the links to create a gallery don't show up. Do you have an idea how to fix this?

I've tried to use config.tx_extbase.objects.Tx_PtExtbase_Rbac_RbacServiceInterface.className = Tx_PtExtbase_Rbac_TypoScriptRbacService. This results in the correct service being loaded sometimes but not always. For some requests the dummy implementation (RbacService) is still being used.

matthias-g commented 7 years ago

This issue seems to be fixed after an update to Typo3 7.6.12.