def has_plugin_permission(user, plugin_type, permission_type):
 from cms.plugin_pool import plugin_pool
 plugin_class = plugin_pool.get_plugin(plugin_type)
 codename = get_model_permission_codename(plugin_class.model, action=permission_type)
 return user.has_perm(codename)

def has_plugin_permission ( user , plugin_type , permission_type ) : from cms . plugin_pool import plugin_pool plugin_class = plugin_pool . get_plugin ( plugin_type ) codename = get_model_permission_codename ( plugin_class . model , action = permission_type ) return user . has_perm ( codename )
checks that a user has permissions for the plugin-type given to perform the action defined in permission_type permission_type should be add .