
-- The following ACL setup means:
-- Admins: all API rights granted
-- Managers: overall API access granted but all rights on entities (list and edit) denied
-- Redactors: overall API access denied
--
-- We use auto-generated id to allow to add ACL in Enterprise Edition, without any conflict on the primary key.
--
-- Dumping data for table `acl_classes`
--

INSERT INTO `acl_classes` (`class_type`) VALUES
    ('pim_api_overall_access'),
    ('pim_api_attribute_list'),
    ('pim_api_attribute_edit'),
    ('pim_api_attribute_option_list'),
    ('pim_api_attribute_option_edit'),
    ('pim_api_category_list'),
    ('pim_api_category_edit'),
    ('pim_api_channel_list'),
    ('pim_api_family_list'),
    ('pim_api_family_variant_list'),
    ('pim_api_family_edit'),
    ('pim_api_locale_list'),
    ('pim_api_attribute_group_list'),
    ('pim_api_attribute_group_edit'),
    ('pim_api_currency_list'),
    ('pim_api_channel_edit'),
    ('pim_api_association_type_list'),
    ('pim_api_association_type_edit'),
    ('pim_api_family_variant_edit')
;

--
-- Dumping data for table `acl_entries`
--

INSERT INTO `acl_entries`
(
    `class_id`,
    `object_identity_id`,
    `security_identity_id`,
    `field_name`,
    `ace_order`,
    `mask`,
    `granting`,
    `granting_strategy`,
    `audit_success`,
    `audit_failure`
)
SELECT id, NULL, 2, NULL, 0, 0, 1, 'all', 0, 0 FROM `acl_classes`;

INSERT INTO `acl_entries`
(
    `class_id`,
    `object_identity_id`,
    `security_identity_id`,
    `field_name`,
    `ace_order`,
    `mask`,
    `granting`,
    `granting_strategy`,
    `audit_success`,
    `audit_failure`
)
SELECT id, NULL, 4, NULL, 0, 0, 1, 'all', 0, 0 FROM `acl_classes` WHERE `class_type` = 'pim_api_overall_access';

--
-- Dumping data for table `acl_object_identities`
--

INSERT INTO `acl_object_identities`
(
    `parent_object_identity_id`,
    `class_id`,
    `object_identifier`,
    `entries_inheriting`
)
SELECT NULL, id, 'action', 1 FROM `acl_classes`;

--
-- Dumping data for table `acl_object_identity_ancestors`
--

INSERT INTO `acl_object_identity_ancestors` (`object_identity_id`, `ancestor_id`)
SELECT id, id FROM `acl_object_identities`;



