How to prevent access to 'Files in no sets'?
Permalink
In Dashboard > File Manager, is there a way to prevent specific users or group from accessing 'Files in no sets'? I am using Advanced Permissions but could not find a way to do this.
I am using 5.6.3.2.
I am using 5.6.3.2.
Edit: I thought I had a way using advanced permissions but it didn't work when I tried it, I'll come back to this.
You could create an "unassigned" set and programmatically assign files not in a set to this set.
There are several events you can hook into for this:
on_file_added_to_set
on_file_removed_from_set
on_file_version_add
https://www.concrete5.org/documentation/developers/5.6/system/events...
Some examples of the scenarios you would code for:
File is uploaded but not assigned to a set, put it in "unassigned".
File that was in "unassigned" but given a set is removed from "unassigned".
File that was in a set, and all sets removed, put it in "unassigned".
There are several events you can hook into for this:
on_file_added_to_set
on_file_removed_from_set
on_file_version_add
https://www.concrete5.org/documentation/developers/5.6/system/events...
Some examples of the scenarios you would code for:
File is uploaded but not assigned to a set, put it in "unassigned".
File that was in "unassigned" but given a set is removed from "unassigned".
File that was in a set, and all sets removed, put it in "unassigned".
I made a package that does just this: https://github.com/mitchray/mr_setless_files...
Now you can control "Setless" files with Advanced Permissions!
Now you can control "Setless" files with Advanced Permissions!
The code on Github looks nicely done.
Thanks John!