Description

The documentation: https://docs.unrealengine.com/en-US/Programming/UnrealArchitecture/Reference/Metadata/index.html

shows the RestrictedToClasses meta syntax as being RestrictedToClasses="Class1, Class2", but the actual code that applies the restrictions expects a space as a delimiter and not a comma.

In BlueprintActionFilterImpl::IsRestrictedClassMember:

 

bIsClassListed = (ClassName == ClassRestrictions) || !!FCString::StrfindDelim(*ClassRestrictions, *ClassName, TEXT(" "));

Changing to using spaces instead of commas works properly:

UCLASS(meta=(RestrictedToClasses="Class1 Class2"))

 
I would suggest changing the actual code to look for commas because using purely spaces as delimiters like this is weird and is unlike every other meta specifier syntax in Unreal which are comma-based.

 

 

Steps to Reproduce

1.Create a New C++ Project in Unreal 4.22

2.Create an UBlueprintFunctionLibrary with at least one Blueprint-exposed function and use the RestrictedToClasses UCLASS meta as shown here to restrict it to more than 1 class: https://docs.unrealengine.com/en-US/Programming/UnrealArchitecture/Reference/Metadata/index.html

 

Expected: All classes listed using the syntax shown in the documentation should be permitted to use the function.

 

Results: Only the last class in the list will be permitted to use the function from the library instead of all the classes listed.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-77597 in the post.

0
Login to Vote

Fixed
ComponentUE - Gameplay
Affects Versions4.214.224.23
Target Fix4.23
Fix Commit7476776
Main Commit7476777
Release Commit7476776
CreatedJul 19, 2019
ResolvedJul 22, 2019
UpdatedSep 6, 2020