Skip to content

Enable app for groups + LDAP doesn't work, loading order issue #11484

Closed

Description

@PVince81

Steps to reproduce

  1. Setup a LDAP server with users and groups, setup a user "user1" in a group "group1" and "user2" in group "group2" in LDAP
  2. Setup LDAP in ownCloud
  3. Check the users page to make sure group membership is recognized
  4. Go to "Apps" page
  5. Enable the calendar app and restrict it to group "group1"
  6. Login as "user1", check app navigation menu
  7. 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.

@blizzz @jnfrmarks @icewind1991

Setting severity to high.
@MTRichards @karlitschek @craigpg please evaluate

Activity

  1. added this to the milestone on Oct 8, 2014
  2. PVince81 commented on Oct 9, 2014

    @PVince81
    ContributorAuthor

    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:

    1. code calls loadApps()
    2. call getEnabledApps() to get the list of apps, filter by "authentication" type
    3. load the authentication apps
    4. call getEnabledApps() again to get correct results when groups enablement is involved
    5. load the remaining apps
  3. blizzz commented on Oct 9, 2014

    @blizzz
    Contributor

    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?

  4. PVince81 commented on Oct 9, 2014

    @PVince81
    ContributorAuthor

    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.

  5. PVince81 commented on Oct 9, 2014

    @PVince81
    ContributorAuthor

    I have a solution here: it will clear the "enabled apps" cache whenever any app of type "authentication" was loaded: #11495

  6. locked as resolved and limited conversation to collaborators on Aug 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions