Needs review
Project:
Paragraphs
Version:
8.x-1.x-dev
Component:
Module: Type Permissions
Priority:
Minor
Category:
Feature request
Assigned:
Reporter:
Created:
18 May 2017 at 08:30 UTC
Updated:
30 Nov 2023 at 14:16 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
thenchev commentedI can take a stab at this.
Comment #3
thenchev commentedHere is a preliminary patch. Working on tests.
Do we need to reexport all the paragraph type across paragraphs and paragraphs collection modules?
Comment #5
acaljuba commentedSmall fixes in schema file.
Comment #6
acaljuba commentedTests have been extended.
Comment #8
acaljuba commentedSmall fixes.
Comment #10
acaljuba commentedSmall fixes. Hopes it goes well this time.
Comment #11
miro_dietikerThis looks pretty much fine.
The only thing is that the permission flag is now introduced in the main module while its implementation is only introduced in the submodule. However, introducing its schema and the API in the submodule might be much more work.
Still want some more review / feedback on some Entity API guy. :-)
Comment #12
miro_dietikerThis should go into third party settings of paragraphs.
It makes no sense to have this as a top level setting that is not implemented in paragraphs.module itself.
This also is not possible in paragraphs.module if it is not setting aware and thus we should use get / setThirdPartySettings then.
We discovered in our use cases that we need to set most of the paragraph type permissions anyway as soon as you have lower privileged users (authenticated) ones that add content too. Thus lowering prio.
Comment #13
thenchev commentedMoved to third party settings. Now everything is in the submodule.
Comment #14
berdirComment #17
partdigital commentedI've rerolled the patch against 8.x-1.x and fixed the automated tests.
Changes can be found in this MR: https://git.drupalcode.org/project/paragraphs/-/merge_requests/83/diffs
I did make one change to however. If the permission setting isn't enabled for a paragraph then that paragraph simply isn't available to use at all. That would require us to turn on the setting for every single paragraph which kind of defeats the purpose of having the setting in the first place.
I've updated the access hooks so that Paragraphs are not restricted if the setting is disabled. This allows us to have some paragraphs that are controlled with permissions and others that aren't. On a site with 20+ paragraphs this helps a lot.
Comment #18
partdigital commented