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
6eaeaaa3
Commit
6eaeaaa3
authored
Jun 09, 2016
by
Shwetha GS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-853 User's name to be mentioned in the top user drop down (saqeeb.s via shwethags)
parent
606690c4
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
102 additions
and
17 deletions
+102
-17
AtlasAuthorizationUtils.java
...pache/atlas/authorize/simple/AtlasAuthorizationUtils.java
+2
-0
BusinessCatalogHeader.html
.../js/templates/business_catalog/BusinessCatalogHeader.html
+1
-2
header.html
dashboardv2/public/js/templates/site/header.html
+4
-2
CommonViewFunction.js
dashboardv2/public/js/utils/CommonViewFunction.js
+12
-0
Globals.js
dashboardv2/public/js/utils/Globals.js
+4
-0
BusinessCatalogHeader.js
...public/js/views/business_catalog/BusinessCatalogHeader.js
+17
-2
Header.js
dashboardv2/public/js/views/site/Header.js
+18
-2
release-log.txt
release-log.txt
+1
-0
AtlasAuthorizationFilter.java
...rg/apache/atlas/web/filters/AtlasAuthorizationFilter.java
+1
-1
AdminResource.java
...in/java/org/apache/atlas/web/resources/AdminResource.java
+42
-8
No files found.
authorization/src/main/java/org/apache/atlas/authorize/simple/AtlasAuthorizationUtils.java
View file @
6eaeaaa3
...
...
@@ -103,6 +103,8 @@ public class AtlasAuthorizationUtils {
String
api
=
getApi
(
contextPath
);
if
(
api
.
startsWith
(
"types"
))
{
resourceTypes
.
add
(
AtlasResourceTypes
.
TYPE
);
}
else
if
(
api
.
startsWith
(
"admin"
)
&&
contextPath
.
contains
(
"/session"
))
{
resourceTypes
.
add
(
AtlasResourceTypes
.
UNKNOWN
);
}
else
if
((
api
.
startsWith
(
"discovery"
)
&&
contextPath
.
contains
(
"/gremlin"
))
||
api
.
startsWith
(
"admin"
)
||
api
.
startsWith
(
"graph"
))
{
resourceTypes
.
add
(
AtlasResourceTypes
.
OPERATION
);
...
...
dashboardv2/public/js/templates/business_catalog/BusinessCatalogHeader.html
View file @
6eaeaaa3
...
...
@@ -14,12 +14,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<ol
class=
"breadcrumb col-md-6"
>
</ol>
<header
class=
"clearfix"
>
<div
class=
"btn-group pull-right"
>
<a
href=
"javascript:void(0);"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"false"
class=
"user-dropdown"
><i
class=
"fa fa-user user-circle"
></i></a>
<a
href=
"javascript:void(0);"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"false"
class=
"user-dropdown"
><
span
class=
"userName"
></span><
i
class=
"fa fa-user user-circle"
></i></a>
<ul
class=
"dropdown-menu"
>
<!-- <li><a href="#">Edit Profile</a></li>
<li><a href="#">Change Password</a></li> -->
...
...
dashboardv2/public/js/templates/site/header.html
View file @
6eaeaaa3
...
...
@@ -16,14 +16,16 @@
-->
<header
class=
"clearfix"
>
<div
class=
"btn-group pull-right"
>
<a
href=
"javascript:void(0);"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"false"
class=
"user-dropdown"
><i
class=
"fa fa-user user-circle "
></i></a>
<a
href=
"javascript:void(0);"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"false"
class=
"user-dropdown"
><
span
class=
"userName"
></span><
i
class=
"fa fa-user user-circle "
></i></a>
<ul
class=
"dropdown-menu"
>
<!-- <li><a href="#">Edit Profile</a></li>
<li><a href="#">Change Password</a></li> -->
<li
class=
"aboutAtlas"
><a
href=
"javascript:void(0)"
>
About
</a></li>
<li><a
target=
"_blank"
href=
"https://cwiki.apache.org/confluence/display/ATLAS/Atlas+Home"
>
Help
</a></li>
<li
role=
"separator"
class=
"divider"
></li>
<li><a
href=
"logout.html"
>
<i
class=
"fa fa-sign-out"
></i>
Logout
</a></li>
<li>
<a
href=
"logout.html"
>
<i
class=
"fa fa-sign-out"
></i>
Logout
</a>
</li>
</ul>
</div>
</header>
dashboardv2/public/js/utils/CommonViewFunction.js
View file @
6eaeaaa3
...
...
@@ -170,5 +170,17 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages'], function(r
});
return
table
;
}
CommonViewFunction
.
userDataFetch
=
function
(
options
)
{
if
(
options
.
url
)
{
$
.
ajax
({
url
:
options
.
url
,
success
:
function
(
response
)
{
if
(
options
.
callback
)
{
options
.
callback
(
response
);
}
}
});
}
}
return
CommonViewFunction
;
});
dashboardv2/public/js/utils/Globals.js
View file @
6eaeaaa3
...
...
@@ -41,6 +41,10 @@ define(['require'], function(require) {
TAG_ADD
:
"Tag Added"
,
TAG_DELETE
:
"Tag Deleted"
}
Globals
.
userLogedIn
=
{
status
:
false
,
response
:
{}
}
return
Globals
;
});
dashboardv2/public/js/views/business_catalog/BusinessCatalogHeader.js
View file @
6eaeaaa3
...
...
@@ -17,8 +17,10 @@
*/
define
([
'require'
,
'hbs!tmpl/business_catalog/BusinessCatalogHeader'
],
function
(
require
,
tmpl
)
{
'hbs!tmpl/business_catalog/BusinessCatalogHeader'
,
'utils/CommonViewFunction'
,
'utils/Globals'
],
function
(
require
,
tmpl
,
CommonViewFunction
,
Globals
)
{
'use strict'
;
var
BusinessCatalogHeader
=
Marionette
.
LayoutView
.
extend
({
...
...
@@ -36,7 +38,20 @@ define(['require',
* @return {[type]} [description]
*/
render
:
function
()
{
var
that
=
this
;
$
(
this
.
el
).
html
(
this
.
template
());
if
(
!
Globals
.
userLogedIn
.
status
)
{
CommonViewFunction
.
userDataFetch
({
url
:
Globals
.
baseURL
+
"/api/atlas/admin/session"
,
callback
:
function
(
response
)
{
that
.
$
(
'.userName'
).
html
(
response
.
userName
);
Globals
.
userLogedIn
.
status
=
true
;
Globals
.
userLogedIn
.
response
=
response
;
}
});
}
else
{
that
.
$
(
'.userName'
).
html
(
Globals
.
userLogedIn
.
response
.
userName
);
}
var
that
=
this
;
if
(
this
.
url
)
{
var
t
=
[];
...
...
dashboardv2/public/js/views/site/Header.js
View file @
6eaeaaa3
...
...
@@ -18,7 +18,9 @@
define
([
'require'
,
'hbs!tmpl/site/header'
,
],
function
(
require
,
tmpl
)
{
'utils/CommonViewFunction'
,
'utils/Globals'
],
function
(
require
,
tmpl
,
CommonViewFunction
,
Globals
)
{
'use strict'
;
var
Header
=
Marionette
.
LayoutView
.
extend
({
...
...
@@ -26,7 +28,21 @@ define(['require',
regions
:
{},
events
:
{},
initialize
:
function
(
options
)
{},
onRender
:
function
()
{}
onRender
:
function
()
{
var
that
=
this
;
if
(
!
Globals
.
userLogedIn
.
status
)
{
CommonViewFunction
.
userDataFetch
({
url
:
Globals
.
baseURL
+
"/api/atlas/admin/session"
,
callback
:
function
(
response
)
{
that
.
$
(
'.userName'
).
html
(
response
.
userName
);
Globals
.
userLogedIn
.
status
=
true
;
Globals
.
userLogedIn
.
response
=
response
;
}
});
}
else
{
that
.
$
(
'.userName'
).
html
(
Globals
.
userLogedIn
.
response
.
userName
);
}
},
});
return
Header
;
});
release-log.txt
View file @
6eaeaaa3
...
...
@@ -22,6 +22,7 @@ ATLAS-409 Atlas will not import avro tables with schema read from a file (dosset
ATLAS-379 Create sqoop and falcon metadata addons (venkatnrangan,bvellanki,sowmyaramesh via shwethags)
ALL CHANGES:
ATLAS-853 User's name to be mentioned in the top user drop down (saqeeb.s via shwethags)
ATLAS-867 Excessive logs: default log level should be set to 'info'; currently it is 'debug' (svimal2106 via sumasai )
ATLAS-870 Add search feature while associating Tags / Terms with entity. (Kalyanikashikar via yhemanth)
ATLAS-865 Edit description functionality for Tags (kevalbhatt18 via yhemanth)
...
...
webapp/src/main/java/org/apache/atlas/web/filters/AtlasAuthorizationFilter.java
View file @
6eaeaaa3
...
...
@@ -104,7 +104,7 @@ public class AtlasAuthorizationFilter extends GenericFilterBean {
Authentication
auth
=
SecurityContextHolder
.
getContext
().
getAuthentication
();
if
(
auth
!=
null
)
{
userName
=
String
.
valueOf
(
auth
.
getPrincipal
()
);
userName
=
auth
.
getName
(
);
Collection
<?
extends
GrantedAuthority
>
authorities
=
auth
.
getAuthorities
();
for
(
GrantedAuthority
c
:
authorities
)
{
groups
.
add
(
c
.
getAuthority
());
...
...
webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java
View file @
6eaeaaa3
...
...
@@ -18,7 +18,18 @@
package
org
.
apache
.
atlas
.
web
.
resources
;
import
com.google.inject.Inject
;
import
java.util.Collection
;
import
java.util.HashSet
;
import
java.util.Set
;
import
javax.inject.Singleton
;
import
javax.ws.rs.GET
;
import
javax.ws.rs.Path
;
import
javax.ws.rs.Produces
;
import
javax.ws.rs.WebApplicationException
;
import
javax.ws.rs.core.MediaType
;
import
javax.ws.rs.core.Response
;
import
org.apache.atlas.AtlasClient
;
import
org.apache.atlas.web.service.ServiceState
;
import
org.apache.atlas.web.util.Servlets
;
...
...
@@ -27,14 +38,11 @@ import org.apache.commons.configuration.PropertiesConfiguration;
import
org.apache.commons.lang.StringUtils
;
import
org.codehaus.jettison.json.JSONException
;
import
org.codehaus.jettison.json.JSONObject
;
import
org.springframework.security.core.Authentication
;
import
org.springframework.security.core.GrantedAuthority
;
import
org.springframework.security.core.context.SecurityContextHolder
;
import
javax.inject.Singleton
;
import
javax.ws.rs.GET
;
import
javax.ws.rs.Path
;
import
javax.ws.rs.Produces
;
import
javax.ws.rs.WebApplicationException
;
import
javax.ws.rs.core.MediaType
;
import
javax.ws.rs.core.Response
;
import
com.google.inject.Inject
;
/**
* Jersey Resource for admin operations.
...
...
@@ -121,4 +129,30 @@ public class AdminResource {
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
}
}
@GET
@Path
(
"session"
)
@Produces
(
Servlets
.
JSON_MEDIA_TYPE
)
public
Response
getUserProfile
()
{
JSONObject
responseData
=
new
JSONObject
();
try
{
Authentication
auth
=
SecurityContextHolder
.
getContext
().
getAuthentication
();
String
userName
=
null
;
Set
<
String
>
groups
=
new
HashSet
<
String
>();
if
(
auth
!=
null
)
{
userName
=
auth
.
getName
();
Collection
<?
extends
GrantedAuthority
>
authorities
=
auth
.
getAuthorities
();
for
(
GrantedAuthority
c
:
authorities
)
{
groups
.
add
(
c
.
getAuthority
());
}
}
responseData
.
put
(
"userName"
,
userName
);
responseData
.
put
(
"groups"
,
groups
);
Response
response
=
Response
.
ok
(
responseData
).
build
();
return
response
;
}
catch
(
JSONException
e
)
{
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
}
}
}
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