You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enable app for groups + LDAP doesn't work, loading order issue #11484
Setup a LDAP server with users and groups, setup a user "user1" in a group "group1" and "user2" in group "group2" in LDAP
Setup LDAP in ownCloud
Check the users page to make sure group membership is recognized
Go to "Apps" page
Enable the calendar app and restrict it to group "group1"
Login as "user1", check app navigation menu
Login as "user2", check app navigation menu
Expected result
For "user1", the calendar icon is there.
For "user2", the calendar icon is not visible.
Actual result
For any user, the calendar icon is not visible
Versions
ownCloud master f664a31
Also observed here #11161 which doesn't fix that particular issue.
A bit of debugging shows that the LDAP group backend is not registered yet when getEnabledApps() is called with inGroup(). The loading order of apps affects it.
Ideally the user management apps need to be loaded earlier.
This is a bit tricky.
Many places in the code call loadApps() without parameter, meaning it should load all apps.
It internally calls getEnabledApps() without having access to groups.
Goal is to try and load the apps in a specific order, having the "authentication" apps be loaded first. And once these are loaded, need to call getEnabledApps()
So basically a possible workflow is:
code calls loadApps()
call getEnabledApps() to get the list of apps, filter by "authentication" type
load the authentication apps
call getEnabledApps() again to get correct results when groups enablement is involved
No, now I found out that authentication is loaded but further calls to loadApps() will use the cached list of enabled apps, which was created from before when authentication was not enabled... need to provide a way to clear that cache after loading the authentication apps.
And I suspect that a similar issue could exist here: #9962
Will have to test that PR with LDAP as well.
Activity
PVince81 commentedon Oct 9, 2014
This is a bit tricky.
Many places in the code call
loadApps()without parameter, meaning it should load all apps.It internally calls
getEnabledApps()without having access to groups.Goal is to try and load the apps in a specific order, having the "authentication" apps be loaded first. And once these are loaded, need to call
getEnabledApps()So basically a possible workflow is:
loadApps()getEnabledApps()to get the list of apps, filter by "authentication" typegetEnabledApps()again to get correct results when groups enablement is involvedblizzz commentedon Oct 9, 2014
What we do so far is to load authentication-type apps very early. Apparently there is a code path where this does not happen, yet?
PVince81 commentedon Oct 9, 2014
No, now I found out that authentication is loaded but further calls to
loadApps()will use the cached list of enabled apps, which was created from before when authentication was not enabled... need to provide a way to clear that cache after loading the authentication apps.And I suspect that a similar issue could exist here: #9962
Will have to test that PR with LDAP as well.
PVince81 commentedon Oct 9, 2014
I have a solution here: it will clear the "enabled apps" cache whenever any app of type "authentication" was loaded: #11495