If no roles are selected for a license type, all roles should be restricted. This does not work for me. I am on core 8.2.6.
In function licensing_license_type_applies_to_user there is a check for empty roles:
if (empty($license_type->get('roles')) || array_intersect($account->getRoles(), $license_type->get('roles'))) {
license_type->get('roles') returns an array of defined roles ie : Array ( [authenticated] => 0 [administrator] => 0 [storeowner] => 0 ) ) and therefor the empty check does not work as expected.
I have attached a patch that filters out empty values in the array before the empty check.
Comment | File | Size | Author |
---|---|---|---|
#2 | restricted_roles-2849725-1.patch | 596 bytes | tbrix |
Comments
Comment #2
tbrix CreditAttribution: tbrix commentedComment #3
trigdog CreditAttribution: trigdog commented