Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
9ffaaaba
Commit
9ffaaaba
authored
7 years ago
by
nixonrodrigues
Committed by
Madhan Neethiraj
7 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2515: fix authorization of delete-classification operation
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
295595db
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
AtlasEntityStoreV1.java
...e/atlas/repository/store/graph/v1/AtlasEntityStoreV1.java
+15
-2
No files found.
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1.java
View file @
9ffaaaba
...
@@ -496,7 +496,7 @@ public class AtlasEntityStoreV1 implements AtlasEntityStore {
...
@@ -496,7 +496,7 @@ public class AtlasEntityStoreV1 implements AtlasEntityStore {
AtlasEntityHeader
entityHeader
=
entityRetriever
.
toAtlasEntityHeaderWithClassifications
(
guid
);
AtlasEntityHeader
entityHeader
=
entityRetriever
.
toAtlasEntityHeaderWithClassifications
(
guid
);
for
(
String
classification
:
classificationNames
)
{
for
(
String
classification
:
classificationNames
)
{
AtlasAuthorizationUtils
.
verifyAccess
(
new
AtlasEntityAccessRequest
(
typeRegistry
,
AtlasPrivilege
.
ENTITY_
UPDAT
E_CLASSIFICATION
,
entityHeader
,
new
AtlasClassification
(
classification
)),
"remove classification: guid="
,
guid
,
", classification="
,
classification
);
AtlasAuthorizationUtils
.
verifyAccess
(
new
AtlasEntityAccessRequest
(
typeRegistry
,
AtlasPrivilege
.
ENTITY_
REMOV
E_CLASSIFICATION
,
entityHeader
,
new
AtlasClassification
(
classification
)),
"remove classification: guid="
,
guid
,
", classification="
,
classification
);
}
}
if
(
LOG
.
isDebugEnabled
())
{
if
(
LOG
.
isDebugEnabled
())
{
...
@@ -508,6 +508,19 @@ public class AtlasEntityStoreV1 implements AtlasEntityStore {
...
@@ -508,6 +508,19 @@ public class AtlasEntityStoreV1 implements AtlasEntityStore {
entityGraphMapper
.
deleteClassifications
(
guid
,
classificationNames
);
entityGraphMapper
.
deleteClassifications
(
guid
,
classificationNames
);
}
}
@GraphTransaction
public
List
<
AtlasClassification
>
retrieveClassifications
(
String
guid
)
throws
AtlasBaseException
{
if
(
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
"Retriving classifications for entity={}"
,
guid
);
}
AtlasEntityHeader
entityHeader
=
entityRetriever
.
toAtlasEntityHeaderWithClassifications
(
guid
);
return
entityHeader
.
getClassifications
();
}
@Override
@Override
@GraphTransaction
@GraphTransaction
public
List
<
AtlasClassification
>
getClassifications
(
String
guid
)
throws
AtlasBaseException
{
public
List
<
AtlasClassification
>
getClassifications
(
String
guid
)
throws
AtlasBaseException
{
...
@@ -758,7 +771,7 @@ public class AtlasEntityStoreV1 implements AtlasEntityStore {
...
@@ -758,7 +771,7 @@ public class AtlasEntityStoreV1 implements AtlasEntityStore {
private
List
<
String
>
getClassificationNames
(
String
guid
)
throws
AtlasBaseException
{
private
List
<
String
>
getClassificationNames
(
String
guid
)
throws
AtlasBaseException
{
List
<
String
>
ret
=
null
;
List
<
String
>
ret
=
null
;
List
<
AtlasClassification
>
classifications
=
get
Classifications
(
guid
);
List
<
AtlasClassification
>
classifications
=
retrieve
Classifications
(
guid
);
if
(
CollectionUtils
.
isNotEmpty
(
classifications
))
{
if
(
CollectionUtils
.
isNotEmpty
(
classifications
))
{
ret
=
new
ArrayList
<>();
ret
=
new
ArrayList
<>();
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment