diff --git a/security-admin/src/main/webapp/react-webapp/src/views/PolicyListing/PolicyPermissionItem.jsx b/security-admin/src/main/webapp/react-webapp/src/views/PolicyListing/PolicyPermissionItem.jsx index 821d39370b..dac3813434 100644 --- a/security-admin/src/main/webapp/react-webapp/src/views/PolicyListing/PolicyPermissionItem.jsx +++ b/security-admin/src/main/webapp/react-webapp/src/views/PolicyListing/PolicyPermissionItem.jsx @@ -448,6 +448,7 @@ export default function PolicyPermissionItem(props) { formValues={formValues} dataMaskIndex={index} serviceCompDetails={serviceCompDetails} + attrName={attrName} /> )} diff --git a/security-admin/src/main/webapp/react-webapp/src/views/PolicyListing/TagBasePermissionItem.jsx b/security-admin/src/main/webapp/react-webapp/src/views/PolicyListing/TagBasePermissionItem.jsx index 5cd2aa6ca2..cda20700c3 100644 --- a/security-admin/src/main/webapp/react-webapp/src/views/PolicyListing/TagBasePermissionItem.jsx +++ b/security-admin/src/main/webapp/react-webapp/src/views/PolicyListing/TagBasePermissionItem.jsx @@ -30,15 +30,22 @@ import { findIndex, isEmpty, includes, - difference + difference, + map } from "lodash"; import { RangerPolicyType } from "Utils/XAEnums"; import { getServiceDef } from "../../utils/appState"; export default function TagBasePermissionItem(props) { const serviceDefs = getServiceDef(); - const { options, inputVal, formValues, serviceCompDetails, dataMaskIndex } = - props; + const { + options, + inputVal, + formValues, + serviceCompDetails, + dataMaskIndex, + attrName + } = props; const [showTagPermissionItem, tagPermissionItem] = useState(false); const msgStyles = { @@ -133,39 +140,47 @@ export default function TagBasePermissionItem(props) { })); } } else { - let enableDenyAndExceptions = []; - let filterAccessOptions = []; - enableDenyAndExceptions = serviceCompDetails?.accessTypes?.filter( - (access) => { - if ( - includes( - serviceDefs?.allServiceDefs - ?.map((servicedef) => { - if ( - servicedef?.options?.enableDenyAndExceptionsInPolicies == - "false" - ) { - return servicedef.name; - } - }) - .filter(Boolean), - access.name.substr(0, access.name.indexOf(":")) - ) - ) { - return access; + if (attrName === "policyItems") { + return map(keys(tagServicePerms), (m) => ({ + value: m, + label: m.toUpperCase() + })); + } else { + let enableDenyAndExceptions = []; + let filterAccessOptions = []; + enableDenyAndExceptions = serviceCompDetails?.accessTypes?.filter( + (access) => { + if ( + includes( + serviceDefs?.allServiceDefs + ?.map((servicedef) => { + if ( + servicedef?.options?.enableDenyAndExceptionsInPolicies == + "false" + ) { + return servicedef.name; + } + }) + .filter(Boolean), + access.name.substr(0, access.name.indexOf(":")) + ) + ) { + return access; + } } - } - ); - filterAccessOptions = groupBy(enableDenyAndExceptions, function (obj) { - let val = obj.name; - return val.substr(0, val.indexOf(":")); - }); - return difference(keys(tagServicePerms), keys(filterAccessOptions))?.map( - (m) => ({ + ); + filterAccessOptions = groupBy(enableDenyAndExceptions, function (obj) { + let val = obj.name; + return val.substr(0, val.indexOf(":")); + }); + return difference( + keys(tagServicePerms), + keys(filterAccessOptions) + )?.map((m) => ({ value: m, label: m.toUpperCase() - }) - ); + })); + } } }; diff --git a/security-admin/src/main/webapp/react-webapp/src/views/SecurityZone/SecurityZoneForm.jsx b/security-admin/src/main/webapp/react-webapp/src/views/SecurityZone/SecurityZoneForm.jsx index 97e6d3b629..fc56b661c3 100644 --- a/security-admin/src/main/webapp/react-webapp/src/views/SecurityZone/SecurityZoneForm.jsx +++ b/security-admin/src/main/webapp/react-webapp/src/views/SecurityZone/SecurityZoneForm.jsx @@ -106,7 +106,7 @@ const SecurityZoneForm = () => { if (isEmpty(values.adminUsers) && isEmpty(values.adminUserGroups)) { errors.adminUserGroups = { required: true, - text: "Please provide atleast one audit user or group!" + text: "Please provide atleast one admin user or group!" }; errors.adminUsers = { required: true,