The permissions are set in dovecot, the IMAP server.
You need to use doveadm acl on command line.
Just to give some ideas:
Get permissions for Junk folder:
doveadm acl get -A Public/Junk
Set permissions for authenticated users to allow read of Junk folder:
doveadm acl set -A Public/Junk authenticated lookup read
Delete permissions for authenticated users on Junk folder:
doveadm acl delete -A Public/Junk authenticated