mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-9985: Allow creation of roles with names of deleted roles
This allows admins to create roles with names of previously deleted roles. Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
90e7cabf4e
commit
de0d1c7893
|
|
@ -50,6 +50,7 @@ import javax.inject.Inject;
|
|||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Local(value = {RoleService.class})
|
||||
|
|
@ -172,7 +173,12 @@ public class RoleManagerImpl extends ManagerBase implements RoleService, Configu
|
|||
rolePermissionsDao.remove(rolePermission.getId());
|
||||
}
|
||||
}
|
||||
return roleDao.remove(role.getId());
|
||||
if (roleDao.remove(role.getId())) {
|
||||
RoleVO roleVO = roleDao.findByIdIncludingRemoved(role.getId());
|
||||
roleVO.setName(role.getName() + "-deleted-" + new Date());
|
||||
return roleDao.update(role.getId(), roleVO);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue