← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17968: minor fix, don't expose userCredentials.user as export view

 

------------------------------------------------------------
revno: 17968
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-01-14 11:18:58 +0700
message:
  minor fix, don't expose userCredentials.user as export view
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserCredentials.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserCredentials.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserCredentials.java	2014-12-30 13:02:09 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserCredentials.java	2015-01-14 04:18:58 +0000
@@ -136,7 +136,7 @@
      * Indicates whether this user was originally self registered.
      */
     private boolean selfRegistered;
-    
+
     /**
      * Indicates whether this credentials is currently an invitation.
      */
@@ -260,9 +260,9 @@
      * of this user credentials, or this user credentials must have the ALL
      * authority.
      *
-     * @param group the user authority group.
+     * @param group                          the user authority group.
      * @param canGrantOwnUserAuthorityGroups indicates whether this users can grant
-     *        its own authority groups to others.
+     *                                       its own authority groups to others.
      */
     public boolean canIssueUserRole( UserAuthorityGroup group, boolean canGrantOwnUserAuthorityGroups )
     {
@@ -290,9 +290,9 @@
      * Indicates whether this user credentials can issue all of the user authority
      * groups in the given collection.
      *
-     * @param groups the collection of user authority groups.
+     * @param groups                         the collection of user authority groups.
      * @param canGrantOwnUserAuthorityGroups indicates whether this users can grant
-     *        its own authority groups to others.
+     *                                       its own authority groups to others.
      */
     public boolean canIssueUserRoles( Collection<UserAuthorityGroup> groups, boolean canGrantOwnUserAuthorityGroups )
     {
@@ -452,6 +452,16 @@
     // Getters and setters
     // -------------------------------------------------------------------------
 
+    @Override
+    @JsonProperty
+    @JsonView( DetailedView.class )
+    @JsonSerialize( as = BaseIdentifiableObject.class )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+    public User getUser()
+    {
+        return super.getUser();
+    }
+
     public String getPassword()
     {
         return password;
@@ -645,10 +655,10 @@
             openId = userCredentials.getOpenId();
             password = StringUtils.isEmpty( userCredentials.getPassword() ) ? password : userCredentials.getPassword();
             passwordLastUpdated = userCredentials.getPasswordLastUpdated();
-            
+
             userAuthorityGroups.clear();
             userAuthorityGroups.addAll( userCredentials.getUserAuthorityGroups() );
-            
+
             catDimensionConstraints.clear();
             catDimensionConstraints.addAll( userCredentials.getCatDimensionConstraints() );