How to restrict file set to a user group

Permalink
Hi,

I have a file set called "Banners" that contains banners displayed randomly at the top of the pages of my site.

I have many administrators (from the administrators group) that are allowed to add/remove images to this file set.

The "Banners" file set is checked "public" since I want all admins to see it. If I leave if "private" only the file set creator sees it.

Now, I have other site editors that sees this file set (through the Sets menu) and can add images to it, thus affecting the live web site with undesired images displaying at the top of pages.

Is there a way to restrict a file sets to only a certain group?

I tried making the file set "private" but it won't show to other admins, and I tried to change the file set permissions to "admin group only" but other non admin users are still able to add files to this file set through their File Managers - event though they cannot see the files the admins put in it.


Thanks!

tomicio
View Replies:
planist1 replied on at Permalink Reply
planist1
This might point you in the right direction...

File in question is the root/concrete/elements/files/add_to_sets.php

If you replace the entire ul tag starting at line 145 - 174 that looks like this:
<ul class="inputs-list">
   <?php  foreach($sets as $s) { 
      $displaySet = true;
      $pf = new Permissions($s);
      if (!$pf->canAddFiles()) { 
         $displaySet = false;
      } else {
         foreach($extensions as $ext) {
            if (!$pf->canAddFileType($ext)) {
               $displaySet = false;
            }
         }
      }
      if ($displaySet) {
      ?>

with this
<ul class="inputs-list">
   <?php  foreach($sets as $s) 
   { 
      $displaySet = true;
      $pf = new Permissions($s);
      if (!$pf->canAddFiles()) 
         { 
            $displaySet = false;
         } 
         else 
         {
            foreach($extensions as $ext) 
               {
                  if (!$pf->canAddFileType($ext)) 
                     {


Maybe?
bbeng89 replied on at Permalink Reply
bbeng89
I just recently faced a similar situation myself. I found it to be pretty difficult to get permissions working properly for file sets but ended up with something that worked pretty well.

Basically, though if you enable advanced permissions (you can get there by going to /index.php/dashboard/system/permissions/advanced/ in your site) then you can set custom permission on your file sets.

So once you have advanced permissions enabled go to /index.php/dashboard/files/sets/ then click on the file set ("banners"). Now you'll see a checkbox that says "Enable custom permissions for this file set." Check that box and hit save and once it refreshes you'll be able to set custom permission on the set, including allowing only certain users/groups.

Hopefully that helps you out. Like I said, I ran into a few issues but with trial and error and some persistence I was able to get it working properly.
TeKnoZiz replied on at Permalink Reply
TeKnoZiz
Ok, so this works fine, yet once enabled, it doesn't allow guests in the front end access to the files in that set. Using the Display Files from a Set addon, it shows as empty. Did you encounter this issue and if so, how did you work around it?