protected void removePortletModelViewPermission() throws Exception {
    RoleTestUtil.removeResourcePermission(
        getRoleName(),
        getResourceName(),
        ResourceConstants.SCOPE_GROUP,
        getPrimKey(),
        ActionKeys.VIEW);

    RoleTestUtil.removeResourcePermission(
        getRoleName(),
        getResourceName(),
        ResourceConstants.SCOPE_INDIVIDUAL,
        getPrimKey(),
        ActionKeys.VIEW);
  }
 protected void tearDownResourcePermission() throws Exception {
   RoleTestUtil.removeResourcePermission(
       RoleConstants.GUEST,
       "com.liferay.document.library.kernel",
       ResourceConstants.SCOPE_GROUP,
       String.valueOf(_group.getGroupId()),
       ActionKeys.VIEW);
 }
  @Override
  public void tearDown() throws Exception {
    super.tearDown();

    RoleTestUtil.removeResourcePermission(
        RoleConstants.GUEST,
        DLPermission.RESOURCE_NAME,
        ResourceConstants.SCOPE_GROUP_TEMPLATE,
        String.valueOf(GroupConstants.DEFAULT_PARENT_GROUP_ID),
        ActionKeys.VIEW);
  }
  @Override
  public void setUp() throws Exception {
    super.setUp();

    _user = UserTestUtil.addUser(null, group.getGroupId());

    _role =
        RoleTestUtil.addRole(
            "Trash Admin",
            RoleConstants.TYPE_REGULAR,
            PortletKeys.TRASH,
            ResourceConstants.SCOPE_COMPANY,
            String.valueOf(TestPropsValues.getCompanyId()),
            ActionKeys.ACCESS_IN_CONTROL_PANEL);

    RoleTestUtil.addResourcePermission(
        RoleConstants.GUEST,
        DLPermission.RESOURCE_NAME,
        ResourceConstants.SCOPE_GROUP_TEMPLATE,
        String.valueOf(GroupConstants.DEFAULT_PARENT_GROUP_ID),
        ActionKeys.VIEW);
  }
  protected void addPortletModelViewPermission() throws Exception {
    RoleTestUtil.addResourcePermission(
        getRoleName(),
        getResourceName(),
        ResourceConstants.SCOPE_GROUP,
        getPrimKey(),
        ActionKeys.VIEW);

    Role role = RoleLocalServiceUtil.getRole(TestPropsValues.getCompanyId(), getRoleName());

    ResourcePermissionLocalServiceUtil.setResourcePermissions(
        group.getCompanyId(),
        getResourceName(),
        ResourceConstants.SCOPE_INDIVIDUAL,
        getPrimKey(),
        role.getRoleId(),
        new String[] {ActionKeys.VIEW});
  }
  protected long[] addStandardRoles() throws Exception {
    _standardRoleIds[0] = RoleTestUtil.addGroupRole(group.getGroupId());
    _standardRoleIds[1] = RoleTestUtil.addGroupRole(group.getGroupId());

    return _standardRoleIds;
  }
  protected long[] addRequiredRoles() throws Exception {
    _requiredRoleIds[0] = RoleTestUtil.addGroupRole(group.getGroupId());
    _requiredRoleIds[1] = RoleTestUtil.addGroupRole(group.getGroupId());

    return _requiredRoleIds;
  }
  protected long[] addForbiddenRoles() throws Exception {
    _forbiddenRoleIds[0] = RoleTestUtil.addGroupRole(group.getGroupId());
    _forbiddenRoleIds[1] = RoleTestUtil.addGroupRole(group.getGroupId());

    return _forbiddenRoleIds;
  }