Using Folder Permissions
Wicked Folders Pro offers robust folder permissions that let you control what roles can view, add, edit, delete, and assign folders. Advanced users can use filters for even more control.
Getting Started
To get started, go to Settings > Wicked Folders in your WordPress admin area and click the “Permissions” tab. From here, you can define new folder collection policies and assign those policies to folder collections.
Folder Collection Policies
A folder collection policy defines which folder permissions each role on your website has. Once you create a policy, you can assign it to one or more folder collections.
For example, you could create a policy that allows everyone to view folders but only allows administrators to create, edit, or delete folders.
You can assign the following permissions:
Create Folders
Gives anyone in a role with this permission the ability to add new folders. The user who creates a folder is the owner of the folder (although the folder owner can be changed by editing the folder).
View Other’s Folders
Gives users the ability to view folders that are owned by other users. When this permission is turned off, users can only see folders that they own.
Edit Other’s Folders
Gives users the ability to edit folders owned by other users. The edit permission allows users to rename, clone, or move folders owned by others. Note that users can always edit folders that they own.
Delete Other’s Folders
Gives users the ability to delete folders owned by other users. Note that users can always delete folders that they own.
Assign Other’s Folders
Gives users the ability to assign (and unassign) items to folders owned by other users. When this permission is turned off, users cannot assign items to other people’s folders or remove items from other people’s folders.
Note: users can always edit, delete, and assign items to/from folders that they own.
Folder Collections
A folder collection refers to a group of folders (usually associated with a post type). For example, the “Pages” folder collection refers to folders used to organize pages.
A folder collection can have a single folder collection policy assigned to it which controls which roles can add, edit, delete, and assign roles within the folder collection.
Note: if a folder collection does not have a folder collection policy assigned, there are no restrictions and anyone with access to that post type can manage the folders within the collection.
Filters
The following filters can be used for more advanced control.
wf_collection_policy_can_create
Controls whether the user can create new folders.
apply_filters( 'wf_collection_policy_can_create', $allowed, $user_id, $this )
Parameters:
- $allowed
(bool) Whether or not the user can perform the action. - $user_id
(int) The ID of the user the permission is being check for. - $this
(Wicked_Folders_Folder_Collection_Policy) The folder collection policy instance.
wf_collection_policy_can_view
Controls whether the user can view a specific folder.
apply_filters( 'wf_collection_policy_can_view', $allowed, $folder_id, $user_id, $this )
Parameters:
- $allowed
(bool) Whether or not the user can perform the action. - $folder_id
(int|string) The folder ID (i.e. term ID) of the folder that the permission is being checked for. - $user_id
(int) The ID of the user the permission is being check for. - $this
(Wicked_Folders_Folder_Collection_Policy) The folder collection policy instance.
wf_collection_policy_can_edit
Controls whether the user can edit a specific folder.
apply_filters( 'wf_collection_policy_can_edit', $allowed, $folder_id, $user_id, $this )
Parameters:
- $allowed
(bool) Whether or not the user can perform the action. - $folder_id
(int|string) The folder ID (i.e. term ID) of the folder that the permission is being checked for. - $user_id
(int) The ID of the user the permission is being check for. - $this
(Wicked_Folders_Folder_Collection_Policy) The folder collection policy instance.
wf_collection_policy_can_delete
Controls whether the user can delete a specific folder.
apply_filters( 'wf_collection_policy_can_delete', $allowed, $folder_id, $user_id, $this )
Parameters:
- $allowed
(bool) Whether or not the user can perform the action. - $folder_id
(int|string) The folder ID (i.e. term ID) of the folder that the permission is being checked for. - $user_id
(int) The ID of the user the permission is being check for. - $this
(Wicked_Folders_Folder_Collection_Policy) The folder collection policy instance.
wf_collection_policy_can_assign
Controls whether the user can assign or unassign items for a specific folder.
apply_filters( 'wf_collection_policy_can_assign', $allowed, $folder_id, $user_id, $this )
Parameters:
- $allowed
(bool) Whether or not the user can perform the action. - $folder_id
(int|string) The folder ID (i.e. term ID) of the folder that the permission is being checked for. - $user_id
(int) The ID of the user the permission is being check for. - $this
(Wicked_Folders_Folder_Collection_Policy) The folder collection policy instance.