feature(delagent): improve permission checking
- pass the variables user_id and user_perm to all functions where they are needed
- extract the permission checks into three functions (for uploads, folders, licenses)
- start adding the permission checks into the correct places (not done yet, not tested yet)
- move admin_folder_delete.php to delagent/ui
- general rewriting of the delagent
partly based on work by @shaheemazmalmmd