symphonycms / members

Members extension for Symphony
http://symphonyextensions.com/extensions/members/
Other
65 stars 38 forks source link

Edit Own #240

Open korelogic opened 10 years ago

korelogic commented 10 years ago

I've just hit some issues with authenticating events using "edit own".

I have 2 sections Member and Organisation. Each member has an organisation field linked to the name in the organisation section but when the member tries to update the organisation while set to 'edit own' it fails authentication.

After a quick look at the code it seems to only map the relationship one way. I'm thinking the solution would be something like this:

public function checkEventPermissions

SELECT `child_section_field_id`
FROM `tbl_sections_association`
WHERE 
(`parent_section_id` = ".extension_Members::getMembersSection()." AND `child_section_id` = ".$section_id." AND `parent_section_field_id` IN ('".implode("','", $field_ids)."'))
OR
(`parent_section_id` = ".$section_id." AND `child_section_id` = ".extension_Members::getMembersSection().")
cremol commented 10 years ago

Not sure if this is a bug, but definitely like to see support for related sections.
Right now 'edit own' only seems to apply to members section directly...