-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74626/
-----------------------------------------------------------

Review request for ranger, Anand Nadar, Ankita Sinha, Madhan Neethiraj, and 
Prashant Satam.


Bugs: https://issues.apache.org/jira/browse/RANGER-4439
    
https://issues.apache.org/jira/browse/https://issues.apache.org/jira/browse/RANGER-4439


Repository: ranger


Description
-------

When resource are added to a security-zone, id started from 1, instead of using 
id of the last resourceBaseInfo from SecurityZone request. With this we are 
moving the logic to increment the id, before creating the 
RangerSecurityZoneResourceBase.


Diffs
-----

  
agents-common/src/main/java/org/apache/ranger/plugin/util/RangerSecurityZoneHelper.java
 ffd1693a1 


Diff: https://reviews.apache.org/r/74626/diff/1/


Testing
-------

Validated by created and updating security-zones with muplitple services. The 
resourceBaseInfo created for them for a service is unique. Please find the 
updated response object:
{
    "id": 7,
    "isEnabled": true,
    "createdBy": "Admin",
    "updatedBy": "Admin",
    "createTime": 1695798279389,
    "updateTime": 1695798279390,
    "name": "zone12",
    "services": {
        "hive3": {
            "resources": [
                {
                    "database": [
                        "hive_1"
                    ],
                    "table": [
                        "hive_1"
                    ]
                },
                {
                    "database": [
                        "hive_2"
                    ],
                    "table": [
                        "hive_2"
                    ]
                },
                {
                    "database": [
                        "hive_3"
                    ],
                    "table": [
                        "hive_3"
                    ]
                },
                {
                    "database": [
                        "hive_4"
                    ],
                    "table": [
                        "hive_4"
                    ]
                }
            ],
            "resourcesBaseInfo": [
                {
                    "id": 1,
                    "createdBy": "mark",
                    "updatedBy": "mark",
                    "createTime": 1695822222915,
                    "updateTime": 1695822222915
                },
                {
                    "id": 2,
                    "createdBy": "mark",
                    "updatedBy": "mark",
                    "createTime": 1695822222915,
                    "updateTime": 1695822222915
                },
                {
                    "id": 3,
                    "createdBy": "mark",
                    "updatedBy": "mark",
                    "createTime": 1695822222915,
                    "updateTime": 1695822222915
                },
                {
                    "id": 4,
                    "createdBy": "mark",
                    "updatedBy": "mark",
                    "createTime": 1695822744692,
                    "updateTime": 1695822744692
                }
            ]
        }
    },
    "adminUsers": [
        "joe"
    ],
    "auditUsers": [
        "joe"
    ]
}


Thanks,

Subhrat Chaudhary

Reply via email to