Primary

Media

You can also control media file access:

From the WordPress Media Library

1) Go to your WordPress Media Library.

Screen Shot 2015-04-09 at 17.45.11

2) Edit your media file.

3) Enter the selected capability in the Access restrictions box.

Screen Shot 2015-04-09 at 17.39.11

Now the Access Restrictions column of your Media Library shows the selected capability.

Screen Shot 2015-04-09 at 17.41.29

Although the attachment page is only accessible for those groups with the selected capability, the image is available when you browse to the file URL, i.e. anyone can access the media file directly through its URL. This is due to how WordPress relates media files through their attachments. The Groups File Access extension can be used to protect access to files and their URLs.

Screen Shot 2015-04-09 at 17.49.26

From the Page/Post Edition

1) Edit your page or post to embed a media file.

Screen Shot 2015-04-09 at 17.51.44

2) Press the Add Media button and select the file you want to upload.

3) You can add or remove the desired capabilities in the Access restrictions box.

4) Hit Insert into page to save changes.

Screen Shot 2015-04-09 at 17.53.27

Only users belonging to the selected group are allowed to access this attachment page.