I have a portlet with my own template and which has <use-default-template>false</use-default-template> in it’s config.
What if I wish to make my own button to remove my portlet from a page? How to handle remove operation? What URL to query? How to know if current user has permission to remove portlets?
I am assuming you wish to remove portlet from javascript, if so
or
where second parameter is skipConfirm. Take a look at /ROOT/html/js/liferayportlet.js
In your template you could test for whether to show close button/icon with