permissions_check:metadata hook alternative?

In my development, I want a "non owner" user to edit a particular metadata on an entity.

Is there any specific hooks (like the deprecated permissions_check:metadata, <entity_type>) which allow editing of selected metadata, rather than allowing editing of the whole entity (using the permissions_check, <entity_type>)?

  • From Elgg documentation: 

    Since 3.0, metadata is not owned and can in principle be updated by any user, who has access to the entity.
    You can still use the hook to prevent the metadata from being written to the database, however it may propagate in ElggEntity properties.
     
    Use ElggEntity::canEdit() before setting metadata, if you want to ensure that only owners/admins can update metadata.

    You can create your own custom function or action and use:

    elgg_call(ELGG_IGNORE_ACCESS, function()

    for such case

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking