Closed (fixed)
Project:
Paragraphs
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
17 Jun 2014 at 15:44 UTC
Updated:
15 Nov 2014 at 17:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
seanbAttached is a first attempt at a patch (based on the beta4 version, sorry for that!).
It seemed relatively easy to add some checks, but it could be that I'm missing some important stuff.
It works for me, please let me know what you think!
Comment #2
jeroen.b commentedLooks good. I'm not really sure this is something that should be handled by the main module...
I think this is overkill to include in the default functionality.
Maybe it's better to get this into a submodule (which could be in the same repo) like modules/paragraphs_permissions?
Comment #3
seanbI will look into that today!
Comment #4
seanbI created a sandbox project for this. Do you want to add this to the module or should this be a seperate project?
https://www.drupal.org/sandbox/seanpenn079/2289265
Comment #5
jeroen.b commentedLooks good.
I'll test this tomorrow. Will add it inside the paragraphs module if it's ok with you?
Comment #6
seanbNo problem!
Comment #7
jeroen.b commentedComment #8
jeroen.b commentedTo be included in beta5
Comment #9
jstollerI haven't had the opportunity to test this sandbox module yet, but I wanted to give you a use case to consider as you move toward implementing this feature in Paragraphs.
I have a Paragraphs bundle for inserting views within my page content. I only want site admins to be able to add/edit these items. However, once a views item has been added to the content on a page, I need my editors to see that the item is there and be able to order it within the list of paragraphs items, but without being able to remove it or edit its contents.
If #2273555: Collapsible paragraphs in node edit form is implemented, then that may be able to help with this. If a user doesn't have permission to use a particular paragraphs bundle then it could be locked in its collapsed state.
Comment #11
jeroen.b commentedThanks @seanB, commited to dev! Please test!
Also did some changes to make it work with the new "paragraph add button method".
My only problem right now is that you are still able to edit when the default edit mode is "open", should be an easy fix, but might I fix it in combination with #2273555.
Comment #12
seanbNice! Thnx for the update..
Comment #13
seanbComment #14
jeroen.b commentedI don't consider this fixed just yet, first want to fix the issue I mentioned in #11, I'm also planning to make it more flexible by making a hook_paragraphs_access to the main module and have the permission module implement it
Comment #15
jeroen.b commentedI rewrote the paragraph_permissions module, I also renamed it to paragraphs_bundle_permissions.
I made a more advanced permission system in paragraphs. By default, everyone has access that also has access tot the host entity, but by implementing hook_paragraphs_item_access you can change the access by returning one of the following:
PARAGRAPHS_ITEM_ACCESS_IGNORE
PARAGRAPHS_ITEM_ACCESS_ALLOW
PARAGRAPHS_ITEM_ACCESS_DENY
I implemented hook_paragraphs_item_access in the paragraphs_bundle_permissions now.
Please test!
Comment #16
jeroen.b commented