FieldSelectorPermissions

FieldSelectorPermissions

#Overview

name: FieldSelectorPermissions

The value of this variable can be defined or overridden in .ini config files. 1 .ini config file referencing this setting variable.

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of FieldSelectorPermissions is to manage and control the visibility and accessibility of properties and functions in the Model-View-ViewModel (MVVM) framework within Unreal Engine 5. It is primarily used for filtering and permission management in the MVVM developer project settings.

This setting variable is part of the ModelViewViewModel plugin, specifically within the ModelViewViewModelBlueprint module. It is utilized by the UMVVMDeveloperProjectSettings class, which is derived from UDeveloperSettings.

The value of this variable is set through the Unreal Engine project settings, as indicated by the UPROPERTY macro with the ‘config’ specifier. It is defined as a TMap that maps FSoftClassPath to FMVVMDeveloperProjectWidgetSettings, allowing for class-specific widget settings.

FieldSelectorPermissions interacts with other variables and functions within the UMVVMDeveloperProjectSettings class, such as AllowedExecutionMode and methods like PropertyHasFiltering, IsPropertyAllowed, and IsFunctionAllowed.

Developers should be aware that this variable plays a crucial role in determining which properties and functions are visible and accessible in the UI for different classes within the MVVM framework. It affects the behavior of property and function filtering based on class hierarchies.

Best practices when using this variable include:

  1. Carefully configuring the permissions to ensure the right balance between accessibility and security.
  2. Regularly reviewing and updating the permissions as the project evolves.
  3. Considering the class hierarchy when setting permissions, as they apply to child classes as well.
  4. Using this in conjunction with other MVVM settings for a comprehensive control over the framework’s behavior.
  5. Documenting any custom permission settings to maintain clarity for team members.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Plugins/Runtime/ModelViewViewModel/Config/BaseModelViewViewModel.ini:11, section: [/Script/ModelViewViewModelBlueprint.MVVMDeveloperProjectSettings]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Plugins/Runtime/ModelViewViewModel/Source/ModelViewViewModelBlueprint/Private/MVVMDeveloperProjectSettings.cpp:56

Scope (from outer to inner):

file
function     bool UMVVMDeveloperProjectSettings::PropertyHasFiltering

Source code excerpt:

	if (ObjectStruct)
	{
		for (const TPair<FSoftClassPath, FMVVMDeveloperProjectWidgetSettings>& PermissionItem : FieldSelectorPermissions)
		{
			if (UClass* ConcreteClass = PermissionItem.Key.ResolveClass())
			{
				if (ObjectStruct->IsChildOf(ConcreteClass))
				{
					const FMVVMDeveloperProjectWidgetSettings& Settings = PermissionItem.Value;

#Loc: <Workspace>/Engine/Plugins/Runtime/ModelViewViewModel/Source/ModelViewViewModelBlueprint/Private/MVVMDeveloperProjectSettings.cpp:112

Scope (from outer to inner):

file
function     bool UMVVMDeveloperProjectSettings::IsPropertyAllowed

Source code excerpt:

		StructPath.SetPath(StringBuilder.ToView());

		for (const TPair<FSoftClassPath, FMVVMDeveloperProjectWidgetSettings>& PermissionItem : FieldSelectorPermissions)
		{
			if (UClass* ConcreteClass = PermissionItem.Key.ResolveClass())
			{
				if (AuthoritativeClass->IsChildOf(ConcreteClass))
				{
					const FMVVMDeveloperProjectWidgetSettings& Settings = PermissionItem.Value;

#Loc: <Workspace>/Engine/Plugins/Runtime/ModelViewViewModel/Source/ModelViewViewModelBlueprint/Private/MVVMDeveloperProjectSettings.cpp:169

Scope (from outer to inner):

file
function     bool UMVVMDeveloperProjectSettings::IsFunctionAllowed

Source code excerpt:

		StructPath.SetPath(StringBuilder);

		for (const TPair<FSoftClassPath, FMVVMDeveloperProjectWidgetSettings>& PermissionItem : FieldSelectorPermissions)
		{
			if (UClass* ConcreteClass = PermissionItem.Key.ResolveClass())
			{
				if (AuthoritativeClass->IsChildOf(ConcreteClass))
				{
					const FMVVMDeveloperProjectWidgetSettings& Settings = PermissionItem.Value;

#Loc: <Workspace>/Engine/Plugins/Runtime/ModelViewViewModel/Source/ModelViewViewModelBlueprint/Public/MVVMDeveloperProjectSettings.h:97

Scope (from outer to inner):

file
class        class UMVVMDeveloperProjectSettings : public UDeveloperSettings

Source code excerpt:

	/** Permission list for filtering which properties are visible in UI. */
	UPROPERTY(EditAnywhere, config, Category = "Viewmodel")
	TMap<FSoftClassPath, FMVVMDeveloperProjectWidgetSettings> FieldSelectorPermissions;

	/** Permission list for filtering which execution mode is allowed. */
	UPROPERTY(EditAnywhere, config, Category = "Viewmodel")
	TSet<EMVVMExecutionMode> AllowedExecutionMode;
	
	/** Permission list for filtering which context creation type is allowed. */