(5.6) File set permissions

Permalink
Hello all

I've discovered that the documentation for programmatically assigning permissions to file sets seems to be out of date. The page refers to $fs->setPermissions() when in fact the API method is $fs->assignPermissions(), and the arguments suggested don't work with the latest code.

assignPermissions() asks for an array of PermissionKey handles -- is there a list of these somewhere? I've trawled through the code but I can't find any that relate specifically to file sets.

melat0nin
 
nebuleu replied on at Permalink Best Answer Reply
nebuleu
When I search for permissionkey handles, I often use the permissions.xml file used during the installation of c5 :
https://github.com/concrete5/concrete5-legacy/blob/master/web/concre...

<permissionkey handle="view_file_set_file" name="View Files" description="Can view and download files in the site." package="" category="file_set"></permissionkey>
<permissionkey handle="search_file_set" name="Search Files in File Manager" description="Can access the file manager" package="" category="file_set"></permissionkey>
<permissionkey handle="edit_file_set_file_properties" name="Edit File Properties" description="Can edit a file's properties." package="" category="file_set"></permissionkey>
<permissionkey handle="edit_file_set_file_contents" name="Edit File Contents" description="Can edit or replace files in set." package="" category="file_set"></permissionkey>
<permissionkey handle="copy_file_set_files" name="Copy File" description="Can copy files in file set." package="" category="file_set"></permissionkey>
<permissionkey handle="edit_file_set_permissions" name="Edit File Access" description="Can edit access to file sets." package="" category="file_set"></permissionkey>
<permissionkey handle="delete_file_set" name="Delete File Set" description="Can delete file set." package="" category="file_set"></permissionkey>
<permissionkey handle="delete_file_set_files" name="Delete File" description="Can delete files in set." package="" category="file_set"></permissionkey>
<permissionkey handle="add_file" has-custom-class="true" name="Add File" description="Can add files to set." package="" category="file_set"></permissionkey>
melat0nin replied on at Permalink Reply
melat0nin
Thank you, exactly what I needed!