<?php

namespace GemBoards\hooks;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
} // if accessed directly, exit


class MediaLibrary {

	public static function init() {
		add_filter( 'ajax_query_attachments_args', function ( $args ) {
			if ( current_user_can( 'manage_options' ) || current_user_can( 'edit_others_posts' ) ) {
				return $args;
			}

			$args['author'] = get_current_user_id();
			return $args;
		});
	}

}
