-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(acl): allow data deletion for non-reserved predicates (#8937)
when data (non-reserved predicates) is added on UIDs that belong to groot user or guardian group, it is allowed. But when the same data is deleted, that is not allowed. This PR allows deletion of non-reserved predicates on special UIDs. Closes: https://dgraph.atlassian.net/browse/DGRAPHCORE-355
- Loading branch information
1 parent
28ac6c2
commit c2e272b
Showing
12 changed files
with
605 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
��ϡ� | ||
�}�^�6�ρ K��xԊ����s��%U�� ���aj|�Rl� XP��������E���u |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
//go:build integration | ||
|
||
/* | ||
* Copyright 2023 Dgraph Labs, Inc. and Contributors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package bulk | ||
|
||
import ( | ||
"os" | ||
"path/filepath" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
"github.com/stretchr/testify/suite" | ||
|
||
"github.com/dgraph-io/dgraph/dgraphtest" | ||
"github.com/dgraph-io/dgraph/testutil" | ||
) | ||
|
||
type BulkTestSuite struct { | ||
suite.Suite | ||
dc dgraphtest.Cluster | ||
bulkDataDir string | ||
} | ||
|
||
func (bsuite *BulkTestSuite) SetupTest() { | ||
bsuite.dc = dgraphtest.NewComposeCluster() | ||
t := bsuite.T() | ||
var err error | ||
bsuite.bulkDataDir, err = os.MkdirTemp(os.TempDir(), "21millionBulk") | ||
require.NoError(t, err) | ||
require.NoError(t, downloadDataFiles(bsuite.bulkDataDir)) | ||
} | ||
|
||
func (bsuite *BulkTestSuite) TearDownTest() { | ||
testutil.DetectRaceInAlphas(testutil.DockerPrefix) | ||
require.NoError(bsuite.T(), os.RemoveAll(bsuite.bulkDataDir)) | ||
} | ||
|
||
func (bsuite *BulkTestSuite) Upgrade() { | ||
// Not implemented for integration tests | ||
} | ||
|
||
func TestBulkTestSuite(t *testing.T) { | ||
suite.Run(t, new(BulkTestSuite)) | ||
} | ||
|
||
func (bsuite *BulkTestSuite) bulkLoader() error { | ||
bulkDataDir := bsuite.bulkDataDir | ||
rdfFile := filepath.Join(bulkDataDir, "21million.rdf.gz") | ||
schemaFile := filepath.Join(bulkDataDir, "21million.schema") | ||
require.NoError(bsuite.T(), testutil.MakeDirEmpty([]string{"out/0", "out/1", "out/2"})) | ||
return testutil.BulkLoad(testutil.BulkOpts{ | ||
Zero: testutil.SockAddrZero, | ||
Shards: 1, | ||
RdfFile: rdfFile, | ||
SchemaFile: schemaFile, | ||
}) | ||
} | ||
|
||
func (bsuite *BulkTestSuite) StartAlpha() error { | ||
return testutil.StartAlphas("./alpha.yml") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.