Content Management images - permission issues

peterwestergaar
Kilo Expert

Question for the community, to make sure it's not a known error or something.   Also looking for brainstorming for workarounds.

 

When I created a simple CMS page to kick the tires, I created a dynamic block, and used the editor to attach a PNG and a JPG file in the block.

 

When I save and publish the CMS page, and then load it, the images will only display for me when I'm logged in as an admin user.     Non-admin users just show me broken-image icons and alt-text in place of the attached file.  

 

Any idea what might be happening here?  

1 ACCEPTED SOLUTION

Yeah, checking the read ACL for sys_attachment shows a conditional script that I want to puzzle through at some point.   But in the meantime, adding static content block to the exception list (next to the live-feed exception since they seem comparable to me) seemed wise:



    // If the attachment is from live feed, or the static content block of CMS


    // grant it the read access


    if (current.table_name == 'live_profile')


          return true;



    if (current.table_name == 'content_block_static')


      return true;


View solution in original post

9 REPLIES 9

I have never used a attachment in a image tag , so I am not really sure ... Can you create a read acl on the attachment table and see if that solves the issue ?


Yeah, checking the read ACL for sys_attachment shows a conditional script that I want to puzzle through at some point.   But in the meantime, adding static content block to the exception list (next to the live-feed exception since they seem comparable to me) seemed wise:



    // If the attachment is from live feed, or the static content block of CMS


    // grant it the read access


    if (current.table_name == 'live_profile')


          return true;



    if (current.table_name == 'content_block_static')


      return true;


KHDouglas
Giga Expert

Hi Peter,



We have set an ACL on the sys_attachment table which does allow the users to access the images.



or



You can reload the image into Content Management > Images, this would then give the img tags like the ones used in lines 10-12 of your script.



Karl


Thanks Karl,



I suppose I wonder why they allow attachment as an option for uploading a new image for CMS, and what features it would support differently from adding the image to the image library.   I don't see that documented in the wiki.   Any ideas?


The only difference I can think of is the sys_attachment table can administered through System Properties > Security ( to restrict attachment types, size etc) but the same rules are not applied to the library images.



Karl