Jump to content

Specific role unable to edit images within a RepeaterMatrix


a-ok
 Share

Recommended Posts

Hi folks,

I have a contributors specific role set up on PW which allows them to add and edit only their own page(s) to a parent page (Events > event) and have managed to do this by setting up specific template permissions but also include the following in my ready.php file (so they only see their own pages)

function eSubmissionPermissions($event) {

	$page = $event->object;
	if (!$event->return) return;
	if ($page->template->name == "events-detail" && $event->user->id !== $page->createdUser->id) {
		$event->return = false;
	} else {
		$event->return = true;
	}

}
if ($user->hasRole('e-submission')) { // Ony required for 'e-submissions'
	$wire->addHookAfter("Page::listable", null, "eSubmissionPermissions");
}

This all works fine but there's one issue. I have a RepeaterMatrix set up for flexible content and the user/role can add to this fine if the content is text but when they go to add an image it states 'You don't have access to edit' when adding the image. Is there anything extra I should be doing in order to allow this? They can add an image fine that isn't in the RepeaterMatrix. I am using PW 3.0.80. It's also maybe worth noting that I am not allowing this user to publish pages (only save them) as this will be done by the admin on successful admission.

Screen Shot 2018-03-27 at 11.16.03.png

Screen Shot 2018-03-27 at 11.19.26.png

Screen Shot 2018-03-27 at 11.20.00.png

Link to comment
Share on other sites

Maybe it's a permission issue in the repeater matrix  template used by the repeater matrix field?? Though makes me wonder why it works on Text type because that one uses the same template as the other types.

  • Like 1
Link to comment
Share on other sites

1 hour ago, elabx said:

Maybe it's a permission issue in the repeater matrix  template used by the repeater matrix field?? Though makes me wonder why it works on Text type because that one uses the same template as the other types.

Yeah I thought the same :(

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...