if you have trouble to save entity . .

think about this:

"If the code is logged out you'll need to use elgg_set_ignore_access(TRUE) before trying to save."

  • Using a permissions hook is a good way to control write access with no user logged in: http://docs.elgg.org/wiki/Permissions_Check

  • o.k. "elgg_set_ignore_access(TRUE)" is a quick way to unlock the permissions

    after looking to cash's hint . . . and for flexibility, transparency and best practice i did it with a permission hook

    on the page, where i would like to add my new object (without user login)
    i set the context to:  set_context('addsupport');

    in start.php of my pluggin i add this:

       // override object permissions
        register_plugin_hook('permissions_check','object','object_can_edit')

    //  Override the canEdit function to return true for object within a particular context.

      function object_can_edit($hook_name, $entity_type, $return_value, $parameters)
       {
       if (get_context() == 'addsupport')
       {
         return true;
       }
       return $return_value;
       }

    tnx cash