You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/09/15 03:46:27 UTC

[GitHub] [inlong] woofyzhao opened a new pull request, #5898: [INLONG-5897][Manager] Support query audit data by user role

woofyzhao opened a new pull request, #5898:
URL: https://github.com/apache/inlong/pull/5898

   
   - Fixes #5897
   
   ### Motivation
   In some cases, admin and ordinary user may need different audit data view, e.g : 
   only admin needs the complete audit data view, and
   ordinary customer user needs only to know data collection count and sort output out


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] woofyzhao commented on pull request #5898: [INLONG-5897][Manager] Support query audit data by user role

Posted by GitBox <gi...@apache.org>.
woofyzhao commented on PR #5898:
URL: https://github.com/apache/inlong/pull/5898#issuecomment-1248050074

   > 1.Explain why users only pay attention to AUDIT_ID_DATAPROXY_RECEIVED and AUDIT_ID_SORT_OUTPUT? 2.It is suggested that querying audit views based on roles is only a default behavior. Users can also query any audit views according to their own needs.
   
   Excellent idea. Fixed as required.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] healchow commented on a diff in pull request #5898: [INLONG-5897][Manager] Support query audit data by user role

Posted by GitBox <gi...@apache.org>.
healchow commented on code in PR #5898:
URL: https://github.com/apache/inlong/pull/5898#discussion_r971968846


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/AuditServiceImpl.java:
##########
@@ -70,12 +78,21 @@ public class AuditServiceImpl implements AuditService {
     private static final String HOUR_FORMAT = "yyyy-MM-dd HH";
     private static final String DAY_FORMAT = "yyyy-MM-dd";
 
+    @Value("#{'${audit.admin.ids:3,4,5,6,7,8}'.split(',')}")

Review Comment:
   1. The number is not clear for users.
   2. How to set those ids? In a properties file?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] healchow commented on a diff in pull request #5898: [INLONG-5897][Manager] Support query audit data by user role

Posted by GitBox <gi...@apache.org>.
healchow commented on code in PR #5898:
URL: https://github.com/apache/inlong/pull/5898#discussion_r971500758


##########
inlong-common/src/main/java/org/apache/inlong/common/constant/Constants.java:
##########
@@ -23,7 +23,15 @@
 public class Constants {
 
     public static final int RESULT_SUCCESS = 0;
-
     public static final int RESULT_FAIL = 1;
 

Review Comment:
   Suggest creating a new AuditConstants class for those audit constants.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] healchow commented on a diff in pull request #5898: [INLONG-5897][Manager] Support query audit data by user role

Posted by GitBox <gi...@apache.org>.
healchow commented on code in PR #5898:
URL: https://github.com/apache/inlong/pull/5898#discussion_r971507573


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/AuditServiceImpl.java:
##########
@@ -128,6 +148,24 @@ public List<AuditVO> listByCondition(AuditRequest request) throws IOException {
         return aggregateByTimeDim(result, request.getTimeStaticsDim());
     }
 
+    @Override
+    public List<AuditVO> listByRole(AuditRequest request) throws IOException {
+        UserInfo userInfo = LoginUserUtils.getLoginUser();
+        List<String> adminAuditIds = Arrays.asList(

Review Comment:
   Suggest extracting to an immutable constant.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] healchow merged pull request #5898: [INLONG-5897][Manager] Support query audit data by user role

Posted by GitBox <gi...@apache.org>.
healchow merged PR #5898:
URL: https://github.com/apache/inlong/pull/5898


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] woofyzhao commented on a diff in pull request #5898: [INLONG-5897][Manager] Support query audit data by user role

Posted by GitBox <gi...@apache.org>.
woofyzhao commented on code in PR #5898:
URL: https://github.com/apache/inlong/pull/5898#discussion_r972549615


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/AuditServiceImpl.java:
##########
@@ -70,12 +78,21 @@ public class AuditServiceImpl implements AuditService {
     private static final String HOUR_FORMAT = "yyyy-MM-dd HH";
     private static final String DAY_FORMAT = "yyyy-MM-dd";
 
+    @Value("#{'${audit.admin.ids:3,4,5,6,7,8}'.split(',')}")

Review Comment:
   1. doc and inlong audit definition url link added.
   2. set those ids in application.properties like:
   audit.admin.ids = 3,4,5,6,7,8
   audit.user.ids = 3,8
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org