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
340f8637
Commit
340f8637
authored
Feb 13, 2018
by
nixonrodrigues
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2442:- Fix for read-only permission to allow read entity when http method is POST
parent
19d67a13
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
AtlasAccessRequest.java
...n/java/org/apache/atlas/authorize/AtlasAccessRequest.java
+1
-1
AtlasAuthorizationUtils.java
...pache/atlas/authorize/simple/AtlasAuthorizationUtils.java
+7
-2
No files found.
authorization/src/main/java/org/apache/atlas/authorize/AtlasAccessRequest.java
View file @
340f8637
...
@@ -40,7 +40,7 @@ public class AtlasAccessRequest {
...
@@ -40,7 +40,7 @@ public class AtlasAccessRequest {
public
AtlasAccessRequest
(
HttpServletRequest
request
,
String
user
,
Set
<
String
>
userGroups
)
{
public
AtlasAccessRequest
(
HttpServletRequest
request
,
String
user
,
Set
<
String
>
userGroups
)
{
// Spring Security 4 Change => request.getServletPath() -> request.getPathInfo()
// Spring Security 4 Change => request.getServletPath() -> request.getPathInfo()
this
(
AtlasAuthorizationUtils
.
getAtlasResourceType
(
request
.
getPathInfo
()),
"*"
,
AtlasAuthorizationUtils
this
(
AtlasAuthorizationUtils
.
getAtlasResourceType
(
request
.
getPathInfo
()),
"*"
,
AtlasAuthorizationUtils
.
getAtlasAction
(
request
.
getMethod
()),
user
,
userGroups
,
AtlasAuthorizationUtils
.
getRequestIpAddress
(
request
));
.
getAtlasAction
(
request
.
getMethod
()
,
request
.
getPathInfo
()
),
user
,
userGroups
,
AtlasAuthorizationUtils
.
getRequestIpAddress
(
request
));
}
}
public
AtlasAccessRequest
(
Set
<
AtlasResourceTypes
>
resourceType
,
String
resource
,
AtlasActionTypes
action
,
public
AtlasAccessRequest
(
Set
<
AtlasResourceTypes
>
resourceType
,
String
resource
,
AtlasActionTypes
action
,
...
...
authorization/src/main/java/org/apache/atlas/authorize/simple/AtlasAuthorizationUtils.java
View file @
340f8637
...
@@ -71,12 +71,17 @@ public class AtlasAuthorizationUtils {
...
@@ -71,12 +71,17 @@ public class AtlasAuthorizationUtils {
return
api
;
return
api
;
}
}
public
static
AtlasActionTypes
getAtlasAction
(
String
method
)
{
public
static
AtlasActionTypes
getAtlasAction
(
String
method
,
String
contextPath
)
{
AtlasActionTypes
action
=
null
;
AtlasActionTypes
action
=
null
;
switch
(
method
.
toUpperCase
())
{
switch
(
method
.
toUpperCase
())
{
case
"POST"
:
case
"POST"
:
action
=
AtlasActionTypes
.
CREATE
;
String
api
=
getApi
(
contextPath
);
if
(
api
!=
null
&&
api
.
startsWith
(
"search"
))
{
// exceptional case for basic search api with POST method
action
=
AtlasActionTypes
.
READ
;
}
else
{
action
=
AtlasActionTypes
.
CREATE
;
}
break
;
break
;
case
"GET"
:
case
"GET"
:
action
=
AtlasActionTypes
.
READ
;
action
=
AtlasActionTypes
.
READ
;
...
...
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