Fixes permission calculation
authorMatthias Schmidt <gravatronics@live.com>
Fri, 4 Jan 2013 18:52:36 +0000 (19:52 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Fri, 4 Jan 2013 18:52:36 +0000 (19:52 +0100)
commit90a745610f1929aa6065b4de76b0cd9b1c76c442
treee5079318912067ccd72bfd6d6f4fc67a3a73db29
parent1995c363fa017737874efd3e4d7c0d2e7ff65504
Fixes permission calculation

This fix is relevant for user group option types that can have a list of values (e.g. list of usable attachments). In the database, only the difference between the default value and the user group's value is stored. This difference is calculated by `IUserGroupOptionType::diff()`. When the permissions for a certain type of user groups are calculated, the difference for all relevant user groups have to be merged, which is done by `IUserGroupOptionType::merge()`.

The code of the previous merge function is the same as the code of the new diff function. This worked fine when calculating the difference to store the values. But if the merge of two option values was calculated during the permission calculation for a certain type of user groups, again, the difference was calculated, not the merge. This had the effect, that if, for instance, the default value for the usable attachment types was "gif, jpg" and the value for the administrator group was "foo, jpg", administrators were only allowed to use "foo" attachments (which is the diff of the two) instead of "foo", "gif" and "jpg".
13 files changed:
wcfsetup/install/files/lib/acp/form/UserGroupAddForm.class.php
wcfsetup/install/files/lib/acp/form/UserGroupEditForm.class.php
wcfsetup/install/files/lib/acp/form/UserGroupOptionForm.class.php
wcfsetup/install/files/lib/system/option/user/group/BooleanUserGroupOptionType.class.php
wcfsetup/install/files/lib/system/option/user/group/FileSizeUserGroupOptionType.class.php
wcfsetup/install/files/lib/system/option/user/group/IUserGroupOptionType.class.php
wcfsetup/install/files/lib/system/option/user/group/InfiniteIntegerUserGroupOptionType.class.php
wcfsetup/install/files/lib/system/option/user/group/InfiniteInverseIntegerUserGroupOptionType.class.php
wcfsetup/install/files/lib/system/option/user/group/IntegerUserGroupOptionType.class.php
wcfsetup/install/files/lib/system/option/user/group/InverseIntegerUserGroupOptionType.class.php
wcfsetup/install/files/lib/system/option/user/group/TextUserGroupOptionType.class.php
wcfsetup/install/files/lib/system/option/user/group/TextareaUserGroupOptionType.class.php
wcfsetup/install/files/lib/system/option/user/group/UserGroupsUserGroupOptionType.class.php