Skip to content

Commit

Permalink
RANGER-4886: Html-unescaping for user, group and role name on policy …
Browse files Browse the repository at this point in the history
…items
  • Loading branch information
eubnara committed Nov 10, 2024
1 parent 2a340fa commit 67c5611
Showing 1 changed file with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -506,15 +506,21 @@ define(function(require){
if(!_.isUndefined(m.get('groupName')) || !_.isUndefined(m.get("userName")) || !_.isUndefined(m.get('roleName'))){ //groupName or userName
var RangerPolicyItem=Backbone.Model.extend()
var policyItem = new RangerPolicyItem();
if(!_.isUndefined(m.get('groupName')) && !_.isNull(m.get('groupName'))){
policyItem.set("groups",m.get("groupName"));
if (!_.isUndefined(m.get('groupName')) && !_.isNull(m.get('groupName'))) {
policyItem.set("groups", m.get("groupName").map(function (m, i) {
return _.unescape(m);
}));
}
if(!_.isUndefined(m.get('userName')) && !_.isNull(m.get('userName'))){
policyItem.set("users",m.get("userName"));
if (!_.isUndefined(m.get('userName')) && !_.isNull(m.get('userName'))) {
policyItem.set("users", m.get("userName").map(function (m, i) {
return _.unescape(m);
}));
}
if (!_.isUndefined(m.get('roleName')) && !_.isNull(m.get('roleName'))) {
policyItem.set("roles", m.get("roleName").map(function (m, i) {
return _.unescape(m);
}));
}
if(!_.isUndefined(m.get('roleName')) && !_.isNull(m.get('roleName'))){
policyItem.set("roles",m.get("roleName"));
}
if(!(_.isUndefined(m.get('conditions')) && _.isEmpty(m.get('conditions')))){
var RangerPolicyItemConditionList = Backbone.Collection.extend();
var rPolicyItemCondList = new RangerPolicyItemConditionList(m.get('conditions'))
Expand Down

0 comments on commit 67c5611

Please sign in to comment.