CCM NG/ccm-cms: All tests pass again

git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4540 8810af33-2d31-482b-a856-94f89814c4df
ccm-docs
jensp 2017-01-28 13:49:31 +00:00
parent bd963bb48d
commit 7d41d5e94e
5 changed files with 47 additions and 38 deletions

View File

@ -64,7 +64,8 @@ import static org.librecms.CmsConstants.*;
name = "ContentSection.findPermissions",
query = "SELECT p FROM Permission p "
+ "WHERE (p.object = :section "
+ " OR p.object = :rootDocumentsFolder) "
+ " OR p.object = :rootDocumentsFolder"
+ " OR p.object = :rootAssetsFolder) "
+ "AND p.grantee = :role")
})
//@ApplicationType(

View File

@ -343,13 +343,15 @@ public class ContentSectionManager {
contentSection.removeRole(role);
sectionRepo.save(contentSection);
final TypedQuery<Permission> query = entityManager
.createNamedQuery("ContentSection.findPermissions",
Permission.class);
query.setParameter("section", contentSection);
query.setParameter("rootDocumentsFolder",
contentSection.getRootDocumentsFolder());
query.setParameter("rootAssetsFolder",
contentSection.getRootAssetsFolder());
query.setParameter("role", role);
final List<Permission> permissions = query.getResultList();

View File

@ -75,7 +75,7 @@ import org.librecms.lifecycle.LifecycleDefinitionRepository;
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_cms_schema.sql"})
@CleanupUsingScript({"no-cleanup.sql"})
@CleanupUsingScript({"cleanup.sql"})
public class ContentSectionManagerTest {
@Inject

View File

@ -349,32 +349,38 @@
granted_privilege="view_draft_items"
object_id="-10100"
grantee_id="-3100"
creation_date="2016-07-15"/>
creation_date="2016-07-15"
inherited="false" />
<ccm_core.permissions permission_id="-4200"
granted_privilege="view_draft_items"
object_id="-10400"
grantee_id="-3100"
creation_date="2016-07-15"/>
creation_date="2016-07-15"
inherited="false" />
<ccm_core.permissions permission_id="-4300"
granted_privilege="view_draft_items"
object_id="-10200"
grantee_id="-3200"
creation_date="2016-07-15"/>
creation_date="2016-07-15"
inherited="false" />
<ccm_core.permissions permission_id="-4400"
granted_privilege="view_draft_items"
object_id="-10100"
grantee_id="-3300"
creation_date="2016-07-15"/>
creation_date="2016-07-15"
inherited="false" />
<ccm_core.permissions permission_id="-4500"
granted_privilege="view_draft_items"
object_id="-10200"
grantee_id="-3300"
creation_date="2016-07-15"/>
creation_date="2016-07-15"
inherited="false" />
<ccm_core.permissions permission_id="-4600"
granted_privilege="view_draft_items"
object_id="-10300"
grantee_id="-3300"
creation_date="2016-07-15"/>
creation_date="2016-07-15"
inherited="false" />
</dataset>

View File

@ -1295,202 +1295,202 @@
object_id="-2300"
grantee_id="-32000"
creation_date="2016-07-15"
inherited="false"
inherited="true"
inherited_from_id="-1200" />
<ccm_core.permissions permission_id="-5120000"
granted_privilege="create_new_items"
object_id="-2300"
grantee_id="-32000"
creation_date="2016-07-15"
inherited="false"
inherited="true"
inherited_from_id="-1200" />
<ccm_core.permissions permission_id="-5130000"
granted_privilege="edit_items"
object_id="-2300"
grantee_id="-32000"
creation_date="2016-07-15"
inherited="false"
inherited="true"
inherited_from_id="-1200" />
<ccm_core.permissions permission_id="-5140000"
granted_privilege="view_published_items"
object_id="-2300"
grantee_id="-32000"
creation_date="2016-07-15"
inherited="false"
inherited="true"
inherited_from_id="-1200" />
<ccm_core.permissions permission_id="-5150000"
granted_privilege="preview_items"
object_id="-2300"
grantee_id="-32000"
creation_date="2016-07-15"
inherited="false"
inherited="true"
inherited_from_id="-1200" />
<ccm_core.permissions permission_id="-5210000"
granted_privilege="categorize_items"
object_id="-2300"
grantee_id="-33000"
creation_date="2016-07-15"
inherited="false"
inherited="true"
inherited_from_id="-1200" />
<ccm_core.permissions permission_id="-5220000"
granted_privilege="create_new_items"
object_id="-2300"
grantee_id="-33000"
creation_date="2016-07-15"
inherited="false"
inherited="true"
inherited_from_id="-1200" />
<ccm_core.permissions permission_id="-5230000"
granted_privilege="edit_items"
object_id="-2300"
grantee_id="-33000"
creation_date="2016-07-15"
inherited="false"
inherited="true"
inherited_from_id="-1200" />
<ccm_core.permissions permission_id="-5240000"
granted_privilege="approve_items"
object_id="-2300"
grantee_id="-33000"
creation_date="2016-07-15"
inherited="false"
inherited="true"
inherited_from_id="-1200" />
<ccm_core.permissions permission_id="-5250000"
granted_privilege="delete_items"
object_id="-2300"
grantee_id="-33000"
creation_date="2016-07-15"
inherited="false"
inherited="true"
inherited_from_id="-1200" />
<ccm_core.permissions permission_id="-5260000"
granted_privilege="view_published_items"
object_id="-2300"
grantee_id="-33000"
creation_date="2016-07-15"
inherited="false"
inherited="true"
inherited_from_id="-1200" />
<ccm_core.permissions permission_id="-5270000"
granted_privilege="preview_items"
object_id="-2300"
grantee_id="-33000"
creation_date="2016-07-15"
inherited="false"
inherited="true"
inherited_from_id="-1200" />
<ccm_core.permissions permission_id="-5360000"
granted_privilege="categorize_items"
object_id="-2300"
grantee_id="-34000"
creation_date="2016-07-15"
inherited="false"
inherited="true"
inherited_from_id="-1200" />
<ccm_core.permissions permission_id="-5370000"
granted_privilege="create_new_items"
object_id="-2300"
grantee_id="-34000"
creation_date="2016-07-15"
inherited="false"
inherited="true"
inherited_from_id="-1200" />
<ccm_core.permissions permission_id="-5380000"
granted_privilege="edit_items"
object_id="-2300"
grantee_id="-34000"
creation_date="2016-07-15"
inherited="false"
inherited="true"
inherited_from_id="-1200" />
<ccm_core.permissions permission_id="-5390000"
granted_privilege="approve_items"
object_id="-2300"
grantee_id="-34000"
creation_date="2016-07-15"
inherited="false"
inherited="true"
inherited_from_id="-1200" />
<ccm_core.permissions permission_id="-5400000"
granted_privilege="publish_items"
object_id="-2300"
grantee_id="-34000"
creation_date="2016-07-15"
inherited="false"
inherited="true"
inherited_from_id="-1200" />
<ccm_core.permissions permission_id="-5410000"
granted_privilege="delete_items"
object_id="-2300"
grantee_id="-34000"
creation_date="2016-07-15"
inherited="false"
inherited="true"
inherited_from_id="-1200" />
<ccm_core.permissions permission_id="-5420000"
granted_privilege="view_published_items"
object_id="-2300"
grantee_id="-34000"
creation_date="2016-07-15"
inherited="false"
inherited="true"
inherited_from_id="-1200" />
<ccm_core.permissions permission_id="-5430000"
granted_privilege="preview_items"
object_id="-2300"
grantee_id="-34000"
creation_date="2016-07-15"
inherited="false"
inherited="true"
inherited_from_id="-1200" />
<ccm_core.permissions permission_id="-5510000"
granted_privilege="categorize_items"
object_id="-2300"
grantee_id="-35000"
creation_date="2016-07-15"
inherited="false"
inherited="true"
inherited_from_id="-1200" />
<ccm_core.permissions permission_id="-5520000"
granted_privilege="create_new_items"
object_id="-2300"
grantee_id="-35000"
creation_date="2016-07-15"
inherited="false"
inherited="true"
inherited_from_id="-1200" />
<ccm_core.permissions permission_id="-5530000"
granted_privilege="edit_items"
object_id="-2300"
grantee_id="-35000"
creation_date="2016-07-15"
inherited="false"
inherited="true"
inherited_from_id="-1200" />
<ccm_core.permissions permission_id="-5540000"
granted_privilege="approve_items"
object_id="-2300"
grantee_id="-35000"
creation_date="2016-07-15"
inherited="false"
inherited="true"
inherited_from_id="-1200" />
<ccm_core.permissions permission_id="-5550000"
granted_privilege="publish_items"
object_id="-2300"
grantee_id="-35000"
creation_date="2016-07-15"
inherited="false"
inherited="true"
inherited_from_id="-1200" />
<ccm_core.permissions permission_id="-5560000"
granted_privilege="delete_items"
object_id="-2300"
grantee_id="-35000"
creation_date="2016-07-15"
inherited="false"
inherited="true"
inherited_from_id="-1200" />
<ccm_core.permissions permission_id="-5570000"
granted_privilege="view_published_items"
object_id="-2300"
grantee_id="-35000"
creation_date="2016-07-15"
inherited="false" inherited_from_id="-1200" />
inherited="true" inherited_from_id="-1200" />
<ccm_core.permissions permission_id="-5580000"
granted_privilege="preview_items"
object_id="-2300"
grantee_id="-35000"
creation_date="2016-07-15"
inherited="false"
inherited="true"
inherited_from_id="-1200" />
<ccm_core.permissions permission_id="-5610000"
granted_privilege="view_published_items"
object_id="-2300"
grantee_id="-36000"
creation_date="2016-07-15"
inherited="false"
inherited="true"
inherited_from_id="-1200" />
<ccm_core.permissions permission_id="-5160000"
granted_privilege="use_asset"