Permission for custom admin/cockpit plugin

Hi i have created simple plugins for cockpit and admin. I would like to set them permissions so only users with given role/permission would be able to access them. I am able to propagate the permissions from ldap, but i dont know how to set the plugin to require a permission.
I know i can set permissions for whole applications : Admin,Cockpit, Tasks, but i would like to specify actual plugin. Anyone tried to do that?
cheers