## <summary>Patch to gnome module</summary>
## <desc>
##	<p>
##		This will allow tp_mission-control_t to create files
##		with type tp_mission-control_home_t in ~/.cache.
##	</p>
## </desc>

########################################
## <summary>
##	Create objects in a Gnome home directory
##	with an automatic type transition to
##	a specified private type.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
## <param name="private_type">
##	<summary>
##	The type of the object to create.
##	</summary>
## </param>
## <param name="object_class">
##	<summary>
##	The class of the object to be created.
##	</summary>
## </param>
#
interface(`gnome_config_filetrans', `
        gen_require(`
                type config_home_t;
        ')

        filetrans_pattern($1, config_home_t, $2, $3)
        userdom_search_user_home_dirs($1)
')

########################################
## <summary>
##	Create objects in a Gnome home directory
##	with an automatic type transition to
##	a specified private type.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
## <param name="private_type">
##	<summary>
##	The type of the object to create.
##	</summary>
## </param>
## <param name="object_class">
##	<summary>
##	The class of the object to be created.
##	</summary>
## </param>
#
interface(`gnome_data_filetrans', `
        gen_require(`
                type data_home_t;
        ')

        filetrans_pattern($1, data_home_t, $2, $3)
		gnome_search_gconf($1)
')

########################################
## <summary>
##	search gconf homedir (.local)
## </summary>
## <param name="user_domain">
##	<summary>
##	The type of the domain.
##	</summary>
## </param>
#
interface(`gnome_search_gconf',`
	gen_require(`
		type gconf_home_t;
	')

	allow $1 gconf_home_t:dir search_dir_perms;
	userdom_search_user_home_dirs($1)
')

########################################
## <summary>
##	manage generic cache home files (.cache)
## </summary>
## <param name="user_domain">
##	<summary>
##	The type of the domain.
##	</summary>
## </param>
#
interface(`gnome_rw_generic_cache',`
	gen_require(`
		type cache_home_t;
	')

	rw_files_pattern($1, cache_home_t, cache_home_t)
	userdom_search_user_home_dirs($1)
')
