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
45bb769f
Commit
45bb769f
authored
4 years ago
by
nixonrodrigues
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3968:- Refactor the typedef API authoriation error msg from type Name to type guid
Change-Id: I7552084604f6dbe57f98bd33da013255a4facbad
parent
877e2b17
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
18 deletions
+20
-18
AtlasTypeDefGraphStore.java
.../atlas/repository/store/graph/AtlasTypeDefGraphStore.java
+20
-18
No files found.
repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java
View file @
45bb769f
...
...
@@ -137,7 +137,7 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore {
throw
new
AtlasBaseException
(
AtlasErrorCode
.
TYPE_GUID_NOT_FOUND
,
guid
);
}
AtlasAuthorizationUtils
.
verifyAccess
(
new
AtlasTypeAccessRequest
(
AtlasPrivilege
.
TYPE_READ
,
ret
),
"read type "
,
ret
.
getName
()
);
AtlasAuthorizationUtils
.
verifyAccess
(
new
AtlasTypeAccessRequest
(
AtlasPrivilege
.
TYPE_READ
,
ret
),
"read type "
,
guid
);
return
ret
;
}
...
...
@@ -183,7 +183,7 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore {
throw
new
AtlasBaseException
(
AtlasErrorCode
.
TYPE_GUID_NOT_FOUND
,
guid
);
}
AtlasAuthorizationUtils
.
verifyAccess
(
new
AtlasTypeAccessRequest
(
AtlasPrivilege
.
TYPE_READ
,
ret
),
"read type "
,
ret
.
getName
()
);
AtlasAuthorizationUtils
.
verifyAccess
(
new
AtlasTypeAccessRequest
(
AtlasPrivilege
.
TYPE_READ
,
ret
),
"read type "
,
guid
);
return
ret
;
}
...
...
@@ -209,7 +209,7 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore {
throw
new
AtlasBaseException
(
AtlasErrorCode
.
TYPE_GUID_NOT_FOUND
,
guid
);
}
AtlasAuthorizationUtils
.
verifyAccess
(
new
AtlasTypeAccessRequest
(
AtlasPrivilege
.
TYPE_READ
,
ret
),
"read type "
,
ret
.
getName
()
);
AtlasAuthorizationUtils
.
verifyAccess
(
new
AtlasTypeAccessRequest
(
AtlasPrivilege
.
TYPE_READ
,
ret
),
"read type "
,
guid
);
return
ret
;
}
...
...
@@ -235,7 +235,7 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore {
throw
new
AtlasBaseException
(
AtlasErrorCode
.
TYPE_GUID_NOT_FOUND
,
guid
);
}
AtlasAuthorizationUtils
.
verifyAccess
(
new
AtlasTypeAccessRequest
(
AtlasPrivilege
.
TYPE_READ
,
ret
),
"read type "
,
ret
.
getName
()
);
AtlasAuthorizationUtils
.
verifyAccess
(
new
AtlasTypeAccessRequest
(
AtlasPrivilege
.
TYPE_READ
,
ret
),
"read type "
,
guid
);
return
ret
;
}
...
...
@@ -286,7 +286,7 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore {
throw
new
AtlasBaseException
(
AtlasErrorCode
.
TYPE_GUID_NOT_FOUND
,
guid
);
}
AtlasAuthorizationUtils
.
verifyAccess
(
new
AtlasTypeAccessRequest
(
AtlasPrivilege
.
TYPE_READ
,
ret
),
"read type "
,
ret
.
getName
()
);
AtlasAuthorizationUtils
.
verifyAccess
(
new
AtlasTypeAccessRequest
(
AtlasPrivilege
.
TYPE_READ
,
ret
),
"read type "
,
guid
);
return
ret
;
}
...
...
@@ -339,7 +339,7 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore {
throw
new
AtlasBaseException
(
AtlasErrorCode
.
TYPE_GUID_NOT_FOUND
,
guid
);
}
AtlasAuthorizationUtils
.
verifyAccess
(
new
AtlasTypeAccessRequest
(
AtlasPrivilege
.
TYPE_READ
,
ret
),
"read type "
,
ret
.
getName
()
);
AtlasAuthorizationUtils
.
verifyAccess
(
new
AtlasTypeAccessRequest
(
AtlasPrivilege
.
TYPE_READ
,
ret
),
"read type "
,
guid
);
return
ret
;
}
...
...
@@ -765,7 +765,13 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore {
throw
new
AtlasBaseException
(
AtlasErrorCode
.
TYPE_NAME_INVALID
,
""
,
name
);
}
AtlasType
type
=
typeRegistry
.
getType
(
name
);
return
getTypeDefFromType
(
type
);
AtlasBaseTypeDef
ret
=
getTypeDefFromTypeWithNoAuthz
(
type
);
if
(
ret
!=
null
)
{
AtlasAuthorizationUtils
.
verifyAccess
(
new
AtlasTypeAccessRequest
(
AtlasPrivilege
.
TYPE_READ
,
ret
),
"read type "
,
name
);
}
return
ret
;
}
@Override
...
...
@@ -774,7 +780,13 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore {
throw
new
AtlasBaseException
(
AtlasErrorCode
.
TYPE_GUID_NOT_FOUND
,
guid
);
}
AtlasType
type
=
typeRegistry
.
getTypeByGuid
(
guid
);
return
getTypeDefFromType
(
type
);
AtlasBaseTypeDef
ret
=
getTypeDefFromTypeWithNoAuthz
(
type
);
if
(
ret
!=
null
)
{
AtlasAuthorizationUtils
.
verifyAccess
(
new
AtlasTypeAccessRequest
(
AtlasPrivilege
.
TYPE_READ
,
ret
),
"read type "
,
guid
);
}
return
ret
;
}
private
AtlasBaseTypeDef
getByNameNoAuthz
(
String
name
)
throws
AtlasBaseException
{
...
...
@@ -787,16 +799,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore {
return
getTypeDefFromTypeWithNoAuthz
(
type
);
}
private
AtlasBaseTypeDef
getTypeDefFromType
(
AtlasType
type
)
throws
AtlasBaseException
{
AtlasBaseTypeDef
ret
=
getTypeDefFromTypeWithNoAuthz
(
type
);
if
(
ret
!=
null
)
{
AtlasAuthorizationUtils
.
verifyAccess
(
new
AtlasTypeAccessRequest
(
AtlasPrivilege
.
TYPE_READ
,
ret
),
"read type "
,
ret
.
getName
());
}
return
ret
;
}
private
AtlasBaseTypeDef
getTypeDefFromTypeWithNoAuthz
(
AtlasType
type
)
throws
AtlasBaseException
{
AtlasBaseTypeDef
ret
;
switch
(
type
.
getTypeCategory
())
{
...
...
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