PermissionsCheck example code has errors

http://docs.elgg.org/wiki/PermissionsCheck

The example PHP at the bottom - in some cases "myaccess" is used and in other cases "myaccesss" (extra "s") is used.  There needs to be consistency, and preferably the correct spelling method.

What baffles me is that it seems like someone just wrote this code by hand without ever actually testing it out in a live Elgg system.  Because in its current state there's no way in hell it would have done *anything* ;)

  • OK - accesss changed to access

    I believe a lot of the code examples were written without testing by the core developers. Not the best way to introduce people to a platform!

  • Thanks Cash!

    Actually, I don't think that example is even useful at all...with the method described it's impossible to query any entities that don't have access_id = 2 or 1 (PUBLIC or LOGGED_IN).  So it doesn't actually override the permissions check at all.

    I think the issue may be that the permissions_check override function is not actually called when get_entities() is called.

    See this thread - http://community.elgg.org/mod/groups/topicposts.php?topic=185245&group_guid=7

    I could be wrong though, that's just from my experience!

  • I spent some time today fixing the horrible blog tutorial on the wiki. I can see why so many people complain about the documentation. It still needs more cleanup but I think the code is actually functional now.

    I'll probably check out the permissions override code and see what state that is in...

  • What you're doing there is going to save so many people's headaches Cash, well done mate.

    I feel like it might be worth having _another_ go now that it's been sorted.

  • Hey, Kane, I added a warning to that page until the core developers can decide whether they want to allow plugins access to entities that the user does not have read permissions for.

    http://docs.elgg.org/wiki/Permissions_Check

    If you find more things that can be improved with the documentation, please post them here in this group. Thanks.

Feedback and Planning

Feedback and Planning

Discussions about the past, present, and future of Elgg and this community site.