The basic problem here is that you cannot use SharePoint permissions to control access to resources that are outside of SharePoint's control. You can control what SharePoint shows to users when they visit the SharePoint site, so yes, you can control who sees the links when they visit the site, but you are always going to run into the problem of someone passing the link on to someone who shouldn't have it. There is no way to control that.
Regarding how to hide a button rendered through a CEWP though, there are a couple things I can think of.
First, you can wrap your button in a
SPSecurityTrimmedControl element, which will hide the control by not rendering it on the server side if you do not have the correct permissions. However, that control by default only checks for certain specific base permission levels (see here and here). You cannot use it out-of-the-box to check for permissions based on groups, however, if you are comfortable coding in C#, you can extend the class to make it work with groups.
The other thought I had, and this is just off the top of my head, completely untried or tested so I have no idea if it would really work, but... how are you using the CEWP? Entering content directly, or linking to file? Potentially, if you put your HTML for rendering the button in an HTML file that you store on the site somewhere, like in Site Pages or Site Assets, you could link that in to your CEWP to get the markup on the page, but then break permission inheritance on the file in the library, and only give permissions to that file to the group that you want to be able to see the link. Then, maybe SharePoint's natural security trimming mechanism would kick in, and not render that file through the CEWP for people who don't have access to the file.
Again, just a thought, completely untested.
And even so, you still have your basic problem, which is that controlling who can see a link to a file share is not the same thing as controlling access to the file share. A user who has access to the link in SP could still send it to someone who does not have access to see the link, and if your permissions on the file share are not set up correctly, they might be able to gain access there.