DataTypeFilter.TRANSIENT_ONLY does not appear to work with group inheritance
bloodmc opened this issue ยท 1 comments
Description
As title states, when doing a lookup using DataTypeFilter.TRANSIENT_ONLY it does not seem to check group inheritance.
Reproduction steps
- Create a new LP group called 'test'
- Set group 'test' as parent of 'default' group with a group weight of -100
- Apply transient permission to group 'test'.
- Perform a transient permission lookup against the 'default' group for the permission added to 'test'. This lookup should be using DataTypeFilter.TRANSIENT_ONLY in its query.
- LuckPerms returns undefined.
Expected behaviour
I would expect the inherited transient value to be returned if not found in 'default'. I would also expect transient permissions to respect group weight (not sure if it does).
Environment details
Local Windows 10 test environment
- LuckPerms version:
5.3.48
running Paper 1.16.5 build 778
Any other relevant details
If I change DataTypeFilter from TRANSIENT_ONLY to ALL, it returns the permissions in the inherited group.
Here is the relevant code for the call
if (type == PermissionDataType.TRANSIENT) {
query = QueryOptions.builder(QueryMode.CONTEXTUAL).option(DataQueryOrderFunction.KEY, DEFAULT_DATA_QUERY_ORDER).option(DataTypeFilterFunction.KEY, DEFAULT_TRANSIENT_ONLY).context(contexts).build();
} else if (type == PermissionDataType.PERSISTENT) {
query = QueryOptions.builder(QueryMode.CONTEXTUAL).option(DataQueryOrderFunction.KEY, DEFAULT_DATA_QUERY_ORDER).option(DataTypeFilterFunction.KEY, DEFAULT_PERSISTENT_ONLY).context(contexts).build();
} else if (type == PermissionDataType.USER_PERSISTENT) {
query = QueryOptions.builder(QueryMode.CONTEXTUAL).option(DataQueryOrderFunction.KEY, DEFAULT_DATA_QUERY_ORDER).option(DataTypeFilterFunction.KEY, USER_PERSISTENT_ONLY).context(contexts).build();
} else {
query = QueryOptions.builder(QueryMode.CONTEXTUAL).option(DataQueryOrderFunction.KEY, DEFAULT_DATA_QUERY_ORDER).context(contexts).build();
}
CachedPermissionData cachedData = permissionHolder.getCachedData().getPermissionData(query);
return getGDTristate(cachedData.checkPermission(permission));